Message195201
> 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). |
|
Date |
User |
Action |
Args |
2013-08-14 19:07:21 | ethan.furman | set | recipients:
+ ethan.furman, barry, eric.smith, eli.bendersky, serhiy.storchaka |
2013-08-14 19:07:21 | ethan.furman | link | issue18738 messages |
2013-08-14 19:07:21 | ethan.furman | create | |
|