On 8/28/07, Eric Smith <[EMAIL PROTECTED]> wrote:
> parse(format_string)

>... returns an iterable of tuples
> (literal_text, field_name, format_spec, conversion)

Which are really either

    (literal_text, None, None, None)
or
    (None, field_name, format_spec, conversion)

I can't help thinking that these two return types shouldn't be
alternatives that both pretend to be 4-tuples.  At the least, they
should be

    "literal text"
vs
    (field_name, format_spec, conversion)

but you might want to take inspiration from the "tail" of an
elementtree node, and return the field with the literal next to it as
a single object.

    (literal_text, field_name, format_spec, conversion)

Where the consumer should output the literal text followed by the
results of formatting the field.  And yes, the last tuple would often
be

    (literal_text, None, None, None)

to indicate no additional fields need processing.

-jJ
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to