[Python-3000] More PEP 3101 changes incoming
Talin
talin at acm.org
Fri Aug 3 18:06:45 CEST 2007
Ron Adam wrote:
> After a fair amount of experimenting today, I think I've found a nice
> middle ground that meets some of what both you and Guido are looking
> for. (And a bit my own preference too.)
First off, thank you very much for taking the time to think about this
in such detail. There are a lot of good ideas here.
What's missing, however, is a description of how all of this interacts
with the __format__ hook. The problem we are facing right now is
sometimes we want to override the __format__ hook and sometimes we
don't. Right now, the model that we want seems to be:
1) High precedence type coercion, i.e. 'r', which bypasses __format__.
2) Check for __format__, and let it interpret the format specifier.
3) Regular type coercion, i.e. 'd', 'f' and so on.
4) Regular formatting based on type.
-- Talin
More information about the Python-3000
mailing list