[Python-3000] More PEP 3101 changes incoming

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 16 03:06:42 CEST 2007


Ron Adam wrote:
> 
> Greg Ewing wrote:
> > The format strings are starting to look like line
> > noise.
> 
> Do you have a specific example or is it just an overall feeling?

It's an overall feeling from looking at your examples.
I can't take them in at a glance -- I have to minutely
examine them character by character, which is tiring.

With the traditional format strings, at least I can
visually parse them without much trouble, even if I
don't know precisely what all the parts mean.`

 > For example the the field alignment
> part can be handled by the format function, and the value format part 
> can be handled by the __format__ method.

Yes, although that seems to be about the *only* thing
that can be separated, and it can be specified using
just one character, which should be easy enough to
strip out before passing on the format string.

> And my apologies if its starting to seem like line noise.  I'm not that 
> good at explaining things in simple ways.

It doesn't really have anything to do with explanation.
As I indicated above, even if I understand exactly
what each part means, it's still hard work parsing
the string if it contains more than a couple of the
allowed elements.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-3000 mailing list