-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-42344: Improve pseudo implementation for SimpleNamespace #23264
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
bpo-42344: Improve pseudo implementation for SimpleNamespace #23264
Conversation
Wheras `SimpleNamespace` is implemented in C, the documentation shows a pseudo implementation in Python for easier understanding. The magic method for the comparison did not take into account that the actual C implementation also compares the types. `__eq__` of the Python pseudo implementation now also compares the types.
Shouldn't the bpo be https://bugs.python.org/issue42344? |
modified: library/types.rst
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
modified: library/types.rst
Yes, I noted that above. If you want to be exact, I gave the code above. #23264 (comment) I guess we should be exactly precise, since the snippet is so short. |
Thanks for your patience! |
Thanks @jugmac00 for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Thanks @jugmac00 for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-23269 is a backport of this pull request to the 3.8 branch. |
GH-23270 is a backport of this pull request to the 3.9 branch. |
Wheras
SimpleNamespace
is implemented in C, the documentation shows apseudo implementation in Python for easier understanding.
The magic method for the comparison did not take into account that the
actual C implementation also compares the types.
__eq__
of the Python pseudo implementation now also compares the types.https://bugs.python.org/issue42344