I'm skeptical about anything that hides an object's "true nature": this is a major landmine in diagnostics because it lies to you about what
you are looking at and where to look for its implementation.
E. g. in this case, AF_UNIX is a member of some entity called "AddressFamily" -- so I would search the code for "AddressFamily" to see what
I'm looking at and what else I can do with it. The fact that it's also directly availabe from the `socket` module is incidental: it could be
as easily made available from anywhere else -- not even a module.
On 25.03.2020 22:54, Ethan Furman wrote:
Serhiy had the idea of having Enum._convert also modify the __str__ and
__repr__ of newly created enumerations to display the module name instead
of the enumeration name (https://bugs.python.org/msg325007):
--> socket.AF_UNIX
<AddressFamily.AF_UNIX: 1> ==> <socket.AF_UNIX: 1>
--> print(socket.AF_UNIX)
AddressFamily.AF_UNIX ==> socket.AF_UNIX
Thoughts?
--
~Ethan~
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/GMOJRM4GPJJJSBYFR4RZSDBVB2SYJAM4/
Code of Conduct: http://python.org/psf/codeofconduct/
--
Regards,
Ivan
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/M2TLOP7O6JSQK5XXKIS6INUXYDONRWV5/
Code of Conduct: http://python.org/psf/codeofconduct/