[Python-3000] More PEP 3101 changes incoming

Adam Olsen rhamph at gmail.com
Sun Aug 5 20:05:48 CEST 2007


On 8/5/07, Talin <talin at acm.org> wrote:
> Ron Adam wrote:
> > To me there is an underlying consistency with grouping abstract/indirect
> > types with more concrete types rather than makeing an exception in the
> > field alignment specifier.
> >
> > Moving repr to the format side sort of breaks the original clean idea of
> > having a field alignment specifier and separate type format specifiers.
>
> The reason for this is because of the constraint that apply_format never
> looks at the format specifier, so overrides for repr() can only go in
> the thing that it does look at - the alignment spec.

How important is this constraint?  In my proposal, apply_format (which
I called handle_format, alas) immediately called __format__.  Only if
__format__ didn't exist or it returned NotImplemented would it check
what type was expected and attempt a coercion (__float__, __index__,
etc), then calling __format__ on that.

-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-3000 mailing list