Opened 9 years ago

Closed 8 years ago

#15991 closed enhancement (fixed)

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

Reported by: Wilfried Luebbe 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, GitHub, GitLab) Commit: 1f0a49b9439c87ad68012159d0f762466eb701cc
Dependencies: Stopgaps:

Status badges

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 9 years ago by Frédéric Chapoton

Authors: Frédéric Chapoton
Branch: u/chapoton/15991
Commit: 1f0a49b9439c87ad68012159d0f762466eb701cc
Status: newneeds_review

New commits:

1f0a49btrac #15991 towards p3 maxint --> maxsize

comment:2 Changed 9 years ago by Wilfried Luebbe

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 9 years ago by Wilfried Luebbe

Status: needs_reviewpositive_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 8 years ago by Volker Braun

Reviewer name

comment:5 Changed 8 years ago by Frédéric Chapoton

Reviewers: Wilfried Luebbe

comment:6 Changed 8 years ago by Volker Braun

Branch: u/chapoton/159911f0a49b9439c87ad68012159d0f762466eb701cc
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.