Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#17398 closed enhancement (fixed)

Changing .next() to next(...)

Reported by: aapitzsch Owned by:
Priority: major Milestone: sage-6.5
Component: misc Keywords: python3
Cc: Merged in:
Authors: André Apitzsch Reviewers: Marc Mezzarobba
Report Upstream: N/A Work issues:
Branch: f505b87 (Commits, GitHub, GitLab) Commit:
Dependencies: #17460 Stopgaps:

Status badges

Description

The next() method is gone in Python 3 and replaced by the next(...) function[1], which is also available in Python 2 [0].

This is part of #16075.

[0] https://docs.python.org/2/library/functions.html#next [1] https://docs.python.org/3/library/functions.html#next

Change History (12)

comment:1 Changed 8 years ago by aapitzsch

Branch: u/aapitzsch/ticket/17398
Commit: 5e09bde1b91d4638392ee93592f4d71c2ad59b35
Status: newneeds_review

comment:2 Changed 8 years ago by git

Commit: 5e09bde1b91d4638392ee93592f4d71c2ad59b35a402461642307b7025649375984baa0216f8aae1

Branch pushed to git repo; I updated commit sha1. New commits:

a402461Merge remote-tracking branch 'origin/develop' into py3_next

comment:3 Changed 8 years ago by Marc Mezzarobba

Status: needs_reviewneeds_work
Work issues: merge conflicts

comment:4 Changed 8 years ago by git

Commit: a402461642307b7025649375984baa0216f8aae10372ae84cf56d82aac3a18302de872b24bce3329

Branch pushed to git repo; I updated commit sha1. New commits:

3a4c52bMerge remote-tracking branch 'origin/develop' into py3_next
0372ae8replace more next() methods by next() function

comment:5 Changed 8 years ago by aapitzsch

Status: needs_workneeds_review
Work issues: merge conflicts

comment:6 Changed 8 years ago by Jeroen Demeyer

Dependencies: #17460
Status: needs_reviewneeds_work

This likely conflicts with #17460, can you rebase on top of that please?

comment:7 Changed 8 years ago by git

Commit: 0372ae84cf56d82aac3a18302de872b24bce3329f505b87b4c15c07ca251f9692f4da41a8a025ab6

Branch pushed to git repo; I updated commit sha1. New commits:

d12c094Deprecate moved imports from sage.misc.misc
026b281Merge ticket/14396 into ticket/17460
92de9fcMake tests 32/64-bit independent
f505b87Merge branch 'u/jdemeyer/ticket/17460' of trac.sagemath.org:sage into py3_next

comment:8 in reply to:  6 Changed 8 years ago by aapitzsch

Status: needs_workneeds_review

Replying to jdemeyer:

This likely conflicts with #17460, can you rebase on top of that please?

Done.

comment:9 Changed 8 years ago by Marc Mezzarobba

Reviewers: Marc Mezzarobba
Status: needs_reviewpositive_review

(Tested with many of the positively reviewed search-and-replace tickets, but perhaps not all.)

comment:10 Changed 8 years ago by Volker Braun

Branch: u/aapitzsch/ticket/17398f505b87b4c15c07ca251f9692f4da41a8a025ab6
Resolution: fixed
Status: positive_reviewclosed

comment:11 Changed 8 years ago by Thierry Monteil

Commit: f505b87b4c15c07ca251f9692f4da41a8a025ab6

It is normal that, on develop.6.8.beta1 i got at least 262 calls to the .next() method ?

$ grep -R '\.next(' | wc -l
262
Last edited 8 years ago by Thierry Monteil (previous) (diff)

comment:12 in reply to:  11 Changed 8 years ago by aapitzsch

Replying to tmonteil:

It is normal that, on develop.6.8.beta1 i got at least 262 calls to the .next() method ?

$ grep -R '\.next(' | wc -l
262

Not all of the .next() method calls can be converted to next(...) function, because the related object is no iterator. I opened #18592 to convert some of the methods.

Note: See TracTickets for help on using tickets.