-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-104219: Document that idunders can return NotImplemented #104220
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
Conversation
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.
I suggest using the relevant role so that NotImplemented
is appropriately formatted and readers can easily jump to more information.
Additionally, you might want to add the role to the adjacent, otherwise-similar descriptions of the __add__
and __radd__
dunders as well (and perhaps explicitly mention for __add__
that the operation falls back to __radd__
if NotImplemented
is returned?).
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
I did that, and in other places too (not in the NotImplemented section itself and only once in some paragraph where it comes up 3 or 4 times). |
Co-authored-by: Jelle Zijlstra <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for the report and PR! |
…thonGH-104220) (cherry picked from commit 2713c2a) Co-authored-by: Gouvernathor <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
GH-116210 is a backport of this pull request to the 3.12 branch. |
…thonGH-104220) (cherry picked from commit 2713c2a) Co-authored-by: Gouvernathor <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
GH-116211 is a backport of this pull request to the 3.11 branch. |
Thank you ! |
…H-104220) (#116210) (cherry picked from commit 2713c2a) Co-authored-by: Gouvernathor <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…H-104220) (#116211) (cherry picked from commit 2713c2a) Co-authored-by: Gouvernathor <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…thon#104220) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…thon#104220) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…thon#104220) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
I tried to change as little as possible but a broader reformulation, or a separate paragraph explaining that when
__iadd__
returns NotImplemented it's the same as if iadd didn't exist at all, could be deemed more readable.📚 Documentation preview 📚: https://cpython-previews--104220.org.readthedocs.build/