-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Python 3 preparation: Py3 has no more the special object-function "__nonzero__" #16076
Comments
This comment has been minimized.
This comment has been minimized.
comment:4
one step done (for the rings folder) in #21887 |
comment:5
another step in #21898 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Commit: |
Branch: u/chapoton/16076 |
comment:10
ok, this was too brutal. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:12
ok, still not subtle enough.. |
comment:13
The way I've seen for this to be 2/3 compatible is to have def __bool__(self):
return self.__nonzero__() |
comment:14
Hello Travis, if you feel like giving it a try, please do. There is an abstract method |
comment:15
I think we should keep things as |
Changed branch from u/chapoton/16076 to none |
Changed commit from |
comment:18
why sage-pending ? |
comment:19
I might be misusing the milestone but this seems to be a very general task ticket not tied to a specific release milestone...? |
comment:20
is this fixed by #24294? |
comment:21
Replying to @tscrim:
I know that this reply is pointless is now, but I guess that something like that would have worked :-) We are doing something similar for division in
|
comment:22
Replying to @fchapoton:
I don't think so by itself--I believe I've found some other examples affected by this (in non-Cython modules) but I could be mistaken. |
The tool 2to3 renames
__nonzero__
to__bool__
.But the code has to depend on the Python version!
Note that this does not affect Cython extension types because Cython supports
__nonzero__
and__bool__
independently of the Python version.There are 25 affected modules.
This ticket is tracked as a dependency of meta-ticket ticket:16052.
CC: @embray
Component: python3
Issue created by migration from https://trac.sagemath.org/ticket/16076
The text was updated successfully, but these errors were encountered: