mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
PEP 3114: rename .next() to .__next__() and add next() builtin.
This commit is contained in:
parent
4d2adcca52
commit
a18af4e7a2
83 changed files with 495 additions and 425 deletions
|
@ -103,7 +103,7 @@ def test_roundtrip(f):
|
|||
|
||||
t1 = [tok[:2] for tok in fulltok]
|
||||
newtext = untokenize(t1)
|
||||
readline = iter(newtext.splitlines(1)).next
|
||||
readline = iter(newtext.splitlines(1)).__next__
|
||||
t2 = [tok[:2] for tok in generate_tokens(readline)]
|
||||
if t1 != t2:
|
||||
raise TestFailed("untokenize() roundtrip failed for %r" % f)
|
||||
|
@ -224,7 +224,7 @@ def test_rarrow():
|
|||
This function exists solely to test the tokenization of the RARROW
|
||||
operator.
|
||||
|
||||
>>> tokenize(iter(['->']).next) #doctest: +NORMALIZE_WHITESPACE
|
||||
>>> tokenize(iter(['->']).__next__) #doctest: +NORMALIZE_WHITESPACE
|
||||
1,0-1,2:\tOP\t'->'
|
||||
2,0-2,0:\tENDMARKER\t''
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue