mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update 1_5_0.md
This commit is contained in:
parent
7aef0a3d5a
commit
402de82d47
@ -134,3 +134,15 @@ for t in my_iter:
|
|||||||
# Create a tuple lazily
|
# Create a tuple lazily
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Builtin function `next()`
|
||||||
|
|
||||||
|
Previously, `next()` returns `StopIteration` when the iterator is exhausted.
|
||||||
|
In `v1.5.0`, it raises `StopIteration` exception instead, which is consistent with CPython.
|
||||||
|
If you like the old way, you can use the following snippet to import the old `next()` function:
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __builtins import next
|
||||||
|
```
|
||||||
|
|
||||||
|
Related C++ APIs do not change. They still return `vm->StopIteration` to indicate the end of iteration.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user