[Python-Dev] format, int, and IntEnum

Glenn Linderman v+python at g.nevcal.com
Thu Aug 15 07:22:52 CEST 2013


On 8/14/2013 9:27 PM, Nick Coghlan wrote:
>
> I think Eric is overinterpreting the spec, there. While that 
> particular sentence requires that the empty format string will be 
> equivalent to a plain str() operation for builtin types, it is only a 
> recommendation for other types. 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) .
>
> Cheers,
> Nick.
>
I could agree with the above for IntEnum, but Enum doesn't have a "base 
type", it has a contained type, no?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130814/a969403d/attachment.html>


More information about the Python-Dev mailing list