Fix: Enum Internals Filter#303
Conversation
acf8cec to
f5e990c
Compare
ae320f7 to
97777de
Compare
|
Uff, that |
97777de to
40df9c2
Compare
|
Fuuun: Python 3.10 symlinks to 3.11 but here we have a test that does not produce idential stubs under both versions. Will split that tree now. |
40df9c2 to
5dd3497
Compare
| Blue: typing.ClassVar[NativeColor] # value = <NativeColor.Blue: 2> | ||
| Red: typing.ClassVar[NativeColor] # value = <NativeColor.Red: 1> | ||
| @classmethod | ||
| def __new__(cls, value): ... |
There was a problem hiding this comment.
I guess this is accepted by _is_sunder but it's weird
There was a problem hiding this comment.
Yes, they are very explicit that double __ is ok:
https://github.com/python/cpython/blob/v3.14.4/Lib/enum.py#L57-L66
This treatment in the stdlib is definitely one of the weirder Python quirks I have seen in a while, but well.
| Blue: typing.ClassVar[NativeColor] # value = <NativeColor.Blue: 2> | ||
| Red: typing.ClassVar[NativeColor] # value = <NativeColor.Red: 1> |
There was a problem hiding this comment.
To check actually, Enum is less flexible than dicts so this might be safe. Anyway, unrelated to this fix, I will track the thought in #305
Fix #302
_sunder_members