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, eric.smith, ethan.furman, serhiy.storchaka
Date 2013-08-14.19:07:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <520BD569.8090503@stoneleaf.us>
In-reply-to <1376506592.53.0.016995600964.issue18738@psf.upfronthosting.co.za>
Content
> Eric V. Smith added the comment:
>
> I assumed we'd want it to look like the str() version of itself, always. But it's debatable.

An IntEnum's str and repr should be (and any format or % codes that are the equivalent) the Enum str and repr.  The % 
and format codes that specifically call for a numeric representation should give that numeric representation (format is 
good here, % is not).

> For format, I think the question is "should an IntEnum format like an int, with the wacky exception of a specifier of '', or should it always format like a str?"
>

I think for format we should treat IntEnums as ints unless the s or r codes are specifically used.

> I agree the %-formatting question is different, and I further think there's not much we can do there.

We can have unicodeobject.c convert int (and float) subclasses to actual ints and floats before getting the numeric 
value (we just did this to _json.c so it could serialize IntEnums).
History
Date User Action Args
2013-08-14 19:07:21ethan.furmansetrecipients: + ethan.furman, barry, eric.smith, eli.bendersky, serhiy.storchaka
2013-08-14 19:07:21ethan.furmanlinkissue18738 messages
2013-08-14 19:07:21ethan.furmancreate