• Eric Smith's avatar
    Modified parsing of format strings, so that we always return · 625cbf28
    Eric Smith yazdı
    a tuple (literal, field_name, format_spec, conversion).
    
    literal will always be a string, but might be of zero length.
    field_name will be None if there is no markup text
    format_spec will be a (possibly zero length) string if
      field_name is non-None
    conversion will be a one character string, or None
    
    This makes the Formatter class, and especially it's parse()
    method, easier to understand.
    
    Suggestion was by Jim Jewett, inspired by the "tail" of an
    elementtree node.
    
    Also, fixed a reference leak in fieldnameiter_next.
    625cbf28
string.py 9.93 KB