string formatting with mapping & '*'... is this a bug?

Alex Martelli aleaxit at yahoo.com
Sat Sep 11 02:13:36 EDT 2004


Pierre Fortin <pfortin at pfortin.com> wrote:

> On Fri, 10 Sep 2004 11:40:48 -0400 I responded to Alex:
> 
> > On Fri, 10 Sep 2004 16:34:31 +0200 Alex wrote:
> > > Come to think of that, you SHOULD hoist the "real format" out of the
> > > loop,
> > 
> > That's a given in my book... :>
> 
> SHEESH!!!  Just now dawned on me what you really meant...
> 
> # hoist *this* part of the formatting code...!
> format = ( "%(Date)ss %(Open)sf %(High)sf %(Low)sf "
>            "%(Close)sf %(Volume)sd %(AdjClose)sf %(Change)ss"
>             % fmt )
> 
> for ...:
>     ...
>     print format % map
> 
> At least I'm getting it...  :>

Yep, that's exactly what I meant.


Alex



More information about the Python-list mailing list