Add discussion about next() vs. __next__(). So far I'm liking next()
jut fine.
This commit is contained in:
parent
c0441481c9
commit
75110765c1
|
@ -97,6 +97,13 @@ C API Specification
|
|||
reference to themselves; this is needed to make it possible to
|
||||
use an iterator (as opposed to a sequence) in a for loop.
|
||||
|
||||
Discussion: should the next() method be renamed to __next__()?
|
||||
Every other method corresponding to a tp_<something> slot has a
|
||||
special name. On the other hand, this would suggest that there
|
||||
should also be a primitive operation next(x) that would call
|
||||
x.__next__(), and this just looks like adding complexity without
|
||||
benefit. So I think it's better to stick with next().
|
||||
|
||||
|
||||
Python API Specification
|
||||
|
||||
|
|
Loading…
Reference in New Issue