Opened 7 years ago

Closed 6 years ago

#15991 closed enhancement (fixed)

Python 3 preparation: Rename sys.maxint to sys.maxsize

Reported by: wluebbe Owned by:
Priority: major Milestone: sage-6.2
Component: distribution Keywords: python3
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Wilfried Luebbe
Report Upstream: N/A Work issues:
Branch: 1f0a49b (Commits) Commit: 1f0a49b9439c87ad68012159d0f762466eb701cc
Dependencies: Stopgaps:

Description

Only the modern name is accepted by Python 3.

Changes according to lib2to3/fixes/renames.py:

sys.maxint -> sys.maxsize

This ticket is tracked as a dependency of meta-ticket ticket:15980.

Change History (6)

comment:1 Changed 7 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/15991
  • Commit set to 1f0a49b9439c87ad68012159d0f762466eb701cc
  • Status changed from new to needs_review

New commits:

1f0a49btrac #15991 towards p3 maxint --> maxsize

comment:2 Changed 7 years ago by wluebbe

Some additional information form WhatsNew Python 3

The sys.maxint constant was removed, since there is no longer a limit to the value of integers. However, sys.maxsize can be used as an integer larger than any practical list or string index. It conforms to the implementation’s “natural” integer size and is typically the same as sys.maxint in previous releases on the same platform (assuming the same build options).

and from the Python 3 docmentation

sys.maxsize

An integer giving the maximum value a variable of type Py_ssize_t can take. It’s usually 2**31 - 1 on a 32-bit platform and 2**63 - 1 on a 64-bit platform.

comment:3 Changed 7 years ago by wluebbe

  • Status changed from needs_review to positive_review

The patch looks good.

I did

git merge u/chapoton/15991 u/wluebbe/ticket/15986 u/wluebbe/ticket/15987

on top of u/wluebbe/ticket/15992 (which is rebased on 6.2.beta5):

./sage -t -p --all --long --logfile=logs/ptestlong-alle4.log
...
All tests passed!

comment:4 Changed 6 years ago by vbraun

Reviewer name

comment:5 Changed 6 years ago by chapoton

  • Reviewers set to Wilfried Luebbe

comment:6 Changed 6 years ago by vbraun

  • Branch changed from u/chapoton/15991 to 1f0a49b9439c87ad68012159d0f762466eb701cc
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.