New submission from Ethan Furman <>:

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


assignee: ethan.furman
messages: 365019
nosy: barry, eli.bendersky, ethan.furman
priority: normal
severity: normal
status: open
title: Enum._convert should change __repr__ and/or __str__ to use module name 
instead of class name
type: enhancement
versions: Python 3.9

Python tracker <>
Python-bugs-list mailing list

Reply via email to