[Python-3000] More PEP 3101 changes incoming

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Aug 12 03:52:11 CEST 2007


Talin wrote:
> we are pretty much forced to divide the format string into 
> two pieces, which are:
> 
>    1) The part that __format__ is allowed to reinterpret.
>    2) The part that __format__ is required to implement without 
> reinterpreting.

or
      2) the part that format() interprets itself without
         involving the __format__ method.

The trouble is, treating 'r' this way means inventing a
whole new part of the format string whose *only* use is
to provide a way of specifying 'r'. Furthermore, whenever
this part is used, the form of the regular format spec
that goes with it will be highly constrained, as it doesn't
make sense to use anything other than an 's'-type format
along with 'r'.

Given the extreme non-orthogonality that these two parts
of the format spec would have, separating them doesn't seem
like a good idea to me. It looks like excessive purity at
the expense of practicality.

> This PEP has not yet been officially 
> accepted, and the reason is because of the lack of an implementation. I 
> don't want to miss the boat.

Although it wouldn't be good to rush things and end
up committed to something that wasn't the best. Py3k
is supposed to be removing warts, not introducing new
ones.

--
Greg


More information about the Python-3000 mailing list