Opened 5 years ago

Closed 4 years ago

Last modified 4 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) Commit:
Dependencies: #17460 Stopgaps:

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 5 years ago by aapitzsch

  • Branch set to u/aapitzsch/ticket/17398
  • Commit set to 5e09bde1b91d4638392ee93592f4d71c2ad59b35
  • Status changed from new to needs_review

comment:2 Changed 5 years ago by git

  • Commit changed from 5e09bde1b91d4638392ee93592f4d71c2ad59b35 to a402461642307b7025649375984baa0216f8aae1

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

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

comment:3 Changed 4 years ago by mmezzarobba

  • Status changed from needs_review to needs_work
  • Work issues set to merge conflicts

comment:4 Changed 4 years ago by git

  • Commit changed from a402461642307b7025649375984baa0216f8aae1 to 0372ae84cf56d82aac3a18302de872b24bce3329

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 4 years ago by aapitzsch

  • Status changed from needs_work to needs_review
  • Work issues merge conflicts deleted

comment:6 follow-up: Changed 4 years ago by jdemeyer

  • Dependencies set to #17460
  • Status changed from needs_review to needs_work

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

comment:7 Changed 4 years ago by git

  • Commit changed from 0372ae84cf56d82aac3a18302de872b24bce3329 to f505b87b4c15c07ca251f9692f4da41a8a025ab6

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 4 years ago by aapitzsch

  • Status changed from needs_work to needs_review

Replying to jdemeyer:

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

Done.

comment:9 Changed 4 years ago by mmezzarobba

  • Reviewers set to Marc Mezzarobba
  • Status changed from needs_review to positive_review

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

comment:10 Changed 4 years ago by vbraun

  • Branch changed from u/aapitzsch/ticket/17398 to f505b87b4c15c07ca251f9692f4da41a8a025ab6
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:11 follow-up: Changed 4 years ago by tmonteil

  • Commit f505b87b4c15c07ca251f9692f4da41a8a025ab6 deleted

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 4 years ago by tmonteil (previous) (diff)

comment:12 in reply to: ↑ 11 Changed 4 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.