-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metaticket: py3: deprecate long and __long__, and remove doctesting special-case for long #27696
Comments
Branch: u/jhpalmieri/long |
Commit: |
comment:2
There are a few places where there should be deprecations but there are not: in rational.pyx and integer.pyx, deprecations lead to deprecations warnings all over the place in the Sage library. In New commits:
|
comment:3
This was done this way very intentionally in #24559, in large part to avoid such a massive patch like this. It would be better I think to wait until Python 2 support is dropped completely. |
comment:4
Right, but that was a year ago. I see no reason to wait until Python 2 support is dropped completely, although if you prefer, we can do this incrementally: say, first add
We should also deprecate The current situation is very misleading, where a doctest will pass with Python 3 but the same code will fail if run by hand. |
comment:5
Replying to @jhpalmieri:
There are many cases like that where the doctests don't work quite the same on Python 3 but in mostly trivial ways which are made transparent by the doctest framework. I think that's ok, personally. However, I do like the idea of adding deprecation warnings to |
This comment has been minimized.
This comment has been minimized.
Changed branch from u/jhpalmieri/long to none |
Changed commit from |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:10
Also, I don't see how deprecating |
comment:12
shall we close this one too ? |
comment:13
Yes. |
The overarching goal of this ticket is to make this change:
With Python 3 doctesting,
long
has been automatically converted toint
. It would be better to not have such a big difference in the behavior of doctesting vs. ordinary Sage usage: with Python 3, evaluatinglong(3)
would fail at the command line but work in doctesting.First we should deprecate
__long__
methods for Sage classes, and we should also designate doctests involvinglong(...)
as beingpy2
only. Once enough of those tasks have been complete, we can make this change to the doctesting framework.See #27826 for a collection of deprecations. This is not complete: that ticket does not deprecate
__long__
for integers and rational numbers.See #27829 for marking some doctests with
# py2
.CC: @mkoeppe
Component: python3
Author: John Palmieri
Issue created by migration from https://trac.sagemath.org/ticket/27696
The text was updated successfully, but these errors were encountered: