-
-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replace Python 2 'long' with Python 3 'int' #39091
Conversation
bca8137
to
1d1fbdf
Compare
1d1fbdf
to
2b08102
Compare
src/sage/libs/mpmath/ext_main.pyx
Outdated
if isinstance(x, (int, Integer)) \ | ||
or isinstance(x, rationallib.mpq): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(x, (int, Integer)) \ | |
or isinstance(x, rationallib.mpq): | |
if isinstance(x, (int, Integer, rationallib.mpq)): |
src/sage/rings/real_mpfi.pyx
Outdated
@@ -818,7 +818,7 @@ cdef class RealIntervalField_class(sage.rings.abc.RealIntervalField): | |||
# Direct and efficient conversions | |||
if S is ZZ or S is QQ: | |||
return True | |||
if S is int or S is long: | |||
if S is int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can join that with the previous conditional.
src/sage/libs/mpmath/ext_main.pyx
Outdated
if isinstance(x, (int, Integer)) \ | ||
or isinstance(x, rationallib.mpq): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(x, (int, Integer)) \ | |
or isinstance(x, rationallib.mpq): | |
if isinstance(x, (int, Integer, rationallib.mpq)): |
@@ -1358,7 +1358,7 @@ cdef class FiniteField(Field): | |||
False | |||
""" | |||
from sage.rings.integer_ring import ZZ | |||
if R is int or R is long or R is ZZ: | |||
if R in int or R is ZZ: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if R in int or R is ZZ: | |
if R is int or R is ZZ: |
if this didn't give a failed test, it might make sense to add a doctest. Well, maybe not.
Documentation preview for this PR (built with commit f398a0f; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
After Cython commit cython/cython@d0f53f40f8c1 8da747919449febc2344ebb43e5f , `long` is no longer valid in `.pyx` file. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39091 Reported by: user202729 Reviewer(s): Martin Rubey
After Cython commit cython/cython@d0f53f40f8c1 8da747919449febc2344ebb43e5f , `long` is no longer valid in `.pyx` file. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39091 Reported by: user202729 Reviewer(s): Martin Rubey
After Cython commit cython/cython@d0f53f40f8c1 8da747919449febc2344ebb43e5f , `long` is no longer valid in `.pyx` file. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39091 Reported by: user202729 Reviewer(s): Martin Rubey
After Cython commit cython/cython@d0f53f4 ,
long
is no longer valid in.pyx
file.📝 Checklist
⌛ Dependencies