Eli Bendersky added the comment:
The whole point of IntEnum and replacing stdlib constants with it was friendly
str & repr out of the box. This means that "just printing out" an enum member
should have a nice string representation. And "just printing out" means:
print(member)
"%s" % member
"{}".format(member)
!s/!r are quite esoteric - IntEnum should behave in the nicest way possible out
of the box.
Let's just rig IntEnum's __format__ to do the right thing and not worry about
Enum itself. I hope that mixin-with-Enum cases are rare (and most are IntEnum
anyway), and in such rare cases users are free to lift the implementation from
IntEnum.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue18738>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com