[Python-Dev] format, int, and IntEnum (original) (raw)
Ethan Furman ethan at stoneleaf.us
Wed Aug 21 08:15:16 CEST 2013
- Previous message: [Python-Dev] format, int, and IntEnum
- Next message: [Python-Dev] format, int, and IntEnum
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 08/14/2013 09:27 PM, Nick Coghlan wrote:
For enums, I believe they should be formatted like their base types (so !s and !r will show the enum name, anything without coercion will show the value) .
I agree. While one of the big reasons for an Enum type was the pretty str and repr, I don't see format in that area.
How often will one type in "{}".format(some_var)
to find out what type
of object one has? Myself, I would just type some_var
.
--
Ethan
- Previous message: [Python-Dev] format, int, and IntEnum
- Next message: [Python-Dev] format, int, and IntEnum
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]