-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: __index__ on Enum should always be present. #3700
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 had the same question last night (but no chance to ask here). I agree with the conclusion!
If you think it's useful to mention in the PR description or changelog: #2801 also "backported" 3.8 behavior. The PR description there mentions another situation where that was the case.
This shouldn't change behavior, since |
I believe (!) this PR broke a couple Google-internal tests. I don't have time to fully dig into the details, but what I see is that generated .pyi files now have extra @henryiii it might be good to add a warning to the upgrade guide. |
I'd first see if it's just that an extra line is being added to a .pyi file - that's not a breaking change unless you are testing the exact methods and making sure a new dunder method is not added (like by comparing string output in such a file); if you simply upgrade Google from Python 3.7 to Python 3.8, these extra lines would have started showing up as well. Now it's just consistent across Python versions. |
Let me know if Python behavior actually changed, I still think that's really unlikely. |
In the meantime the affected team accepted the pybind11 update (and the side-effect changes in their .pyi files) without hesitation. I'll move on with this belief for now: they are harvesting pybind11 docstrings to build their .pyi files. It's actually the same set of .pyi files that was affected when I tested PR #2621 a couple weeks ago, which adds to my belief. Yes, I agree there will likely be issues with the .pyi files again when we upgrade our Python version. |
Description
Tiny bit of minor cleanup.
Suggested changelog entry:
* Enum now has an ``__index__`` method on Python <3.8 too