This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients barry, eli.bendersky, ethan.furman, serhiy.storchaka
Date 2013-08-14.13:48:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376488136.41.0.00729697162282.issue18738@psf.upfronthosting.co.za>
In-reply-to
Content
While `.format()` works fine with enum, %-formatting does not:

--> class AF(enum.IntEnum):
...   IPv4 = 1
...   IPv6 = 2
... 

--> AF.IPv4
<AF.IPv4: 1>

--> '%s' % AF.IPv4
'AF.IPv4'

--> '%r' % AF.IPv4
'<AF.IPv4: 1>'

--> '%d' % AF.IPv4
'AF.IPv4'

--> '%i' % AF.IPv4
'AF.IPv4'

--> '%x' % AF.IPv4
'1'

--> '%o' % AF.IPv4
'1'

Hex and octal work, decimal and integer do not.
History
Date User Action Args
2013-08-14 13:48:56ethan.furmansetrecipients: + ethan.furman, barry, eli.bendersky, serhiy.storchaka
2013-08-14 13:48:56ethan.furmansetmessageid: <1376488136.41.0.00729697162282.issue18738@psf.upfronthosting.co.za>
2013-08-14 13:48:56ethan.furmanlinkissue18738 messages
2013-08-14 13:48:56ethan.furmancreate