On 9/13/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Jim Jewett schrieb:
> > Simply not encoding/decoding until required would save quite a bit of
> > time and space -- but then the object would need some way of
> > indicating which encoding it is in.

> Try implementing that some time. You'll find it will be incredibly
> complex and unmaintainable. Start with implementing len(s).

Simply delegate such methods to a hidden per-encoding subclass.

The UTF-8 methods will indeed be complex, unless the solution is
simply "someone called indexing/slicing/len, so I have to recode after
all."

The Latin-1 encoding will have no such problem.

-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