blueloveTH 1 éve
szülő
commit
402de82d47
1 módosított fájl, 13 hozzáadás és 1 törlés
  1. 13 1
      docs/1_5_0.md

+ 13 - 1
docs/1_5_0.md

@@ -133,4 +133,16 @@ for a, b in my_iter:
 for t in my_iter:
     # 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.