]> granicus.if.org Git - python/commit
Many updates to PEP 292 templates. Summary:
authorBarry Warsaw <barry@python.org>
Fri, 10 Sep 2004 03:08:08 +0000 (03:08 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 10 Sep 2004 03:08:08 +0000 (03:08 +0000)
commit12827c1fa9e6c87248fa1e5e4341066e41ce4ffb
tree2c8f5a24b7b3ff3cd231ad0d5b09e4bde1594f72
parent961c2882a920f137543585175db9957bf48223f3
Many updates to PEP 292 templates.  Summary:

- Template no longer inherits from unicode.

- SafeTemplate is removed.  Now Templates have both a substitute() and a
  safe_substitute() method, so we don't need separate classes.  No more
  __mod__() operator.

- Adopt Tim Peter's idea for giving Template a metaclass, which makes the
  delimiter, the identifier pattern, or the entire pattern easy to override
  and document, while retaining efficiency of class-time compilation of the
  regexp.

- More informative ValueError messages which will help a user narrow down the
  bogus delimiter to the line and column in the original string (helpful for
  long triple quoted strings).
Lib/string.py
Lib/test/test_pep292.py