On 1/18/21 5:53 PM, Ethan Furman wrote:
`__prepare__` returns a dict-like namespace that is used as is. `EnumMeta` uses `__prepare__` to return an instance of `_EnumDict`. When `type.__new__` is called, whatever the namespace used to be is then converted into a normal Python dict, and a mappingproxy is returned for all further `cls.__dict__` requests.
To be more precise, when `__prepare__` is called, there is no class, and therefore no `class.__dict__`. -- ~Ethan~ _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/ABLK4FKI357SPCSKCYNG4BDLKD5UJHPU/ Code of Conduct: http://python.org/psf/codeofconduct/