You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
superlevure
changed the title
Metaclass defined class attribute raise "name-defined" error
Metaclass defined class attribute raise "name-defined" error when used as a type
Jun 24, 2024
Using a Metaclass to define dynamic class (not instance) attributes raises
name-defined
error when trying to use an attribute as a type.To Reproduce
Gist URL: https://gist.github.com/mypy-play/bb0277c6f339cbf374a1d2288cb7d5e6
Playground URL: https://mypy-play.net/?mypy=latest&python=3.12&gist=bb0277c6f339cbf374a1d2288cb7d5e6
Expected Behavior
ProtoWrapper.Direction
should be a valid typeActual Behavior
ProtoWrapper.Direction
raisesname-defined
errorYour Environment
mypy 1.10.0 (compiled: yes)
mypy.ini
(and other config files): NAThe text was updated successfully, but these errors were encountered: