Title: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name
Type: enhancement Stage:
Components: Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: barry, eli.bendersky, ethan.furman
Priority: normal Keywords:

Created on 2020-03-25 19:48 by ethan.furman, last changed 2020-03-25 19:48 by ethan.furman.

Messages (1)
msg365019 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2020-03-25 19:48
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 (

--> socket.AF_UNIX
<AddressFamily.AF_UNIX: 1>   ==>  <socket.AF_UNIX: 1>

--> print(socket.AF_UNIX)
AddressFamily.AF_UNIX        ==>  socket.AF_UNIX

Date User Action Args
2020-03-25 19:48:58ethan.furmancreate