[Python-Dev] format and int subclasses (Was: format, int, and IntEnum) (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Thu Aug 15 01:01:15 CEST 2013
- Previous message: [Python-Dev] format, int, and IntEnum
- Next message: [Python-Dev] format and int subclasses (Was: format, int, and IntEnum)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
15.08.13 01:07, Ethan Furman написав(ла):
Actually the problem not only in IntEnum, but in any in subclass.
Currently for empty format specifier int.format(x, '') returns str(x). But str can be overloaded in a subclass. I think that for less surprising we can extend this behavior for format specifier with the width, the alignment and the fill character but without the type char. I.e. int.format(x. '<10') should return same as format(str(x), '<10').
The question remains what to do with the sign option. And with the '=' alignment.
- Previous message: [Python-Dev] format, int, and IntEnum
- Next message: [Python-Dev] format and int subclasses (Was: format, int, and IntEnum)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]