Uh oh!
There was an error while loading. Please reload this page.
Bring back type annotation support of dunder methods in stub generator (fix #12717) - #12828
Conversation
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
commented
May 21, 2022
Could you take a look at the failing tests? |
bluenote10
commented
May 21, 2022
It basically what @shubz1998 already mentioned in comment #12524 (comment):
As an alternative we can also just re-use the which seems to make sense. With this change, the tests should need no adaptation, and relevant dunder methods like |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |

Have you read the Contributing Guidelines?
Yes.
Description
Fixes#12717 by making the "ignoring of dunder methods" more specific. As explained,
__members__is part of the official enum API and thus an essential type annotation to have. The complete removal of annotations of dunder methods in #12524 causes a big regression for pybind11 code bases involving lots of enums.Test Plan
I didn't had time to add a specific test case preventing fully reverting #12524, but this modification should keep its behavior while fixing #12717.