> Templates are meant to template *text* data, so Unicode is > the right choice of baseclass from a design perspective. Only in Python 3.0. But even so, deriving from Unicode (or str) means the template class inherits a lot of unwanted operations. While I can see that concatenating templates probably works, slicing them or converting to lowercase etc. make no sense. IMO the standard Template class should implement a "narrow" interface, i.e. *only* the template expansion method (__mod__ or something else), so it's clear that other compatible template classes shouldn't have to implement anything besides that. This avoids the issues we have with the mapping protocol: when does an object implement enough of the mapping API to be usable? That's currently ill-defined; sometimes, __getitem__ is all you need, sometimes __contains__ is required, sometimes keys, rarely setdefault. -- --Guido van Rossum (home page: http://www.python.org/~guido/) Ask me about gmail.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4