[Python-3000] Poll: Lazy Unicode Strings For Py3k

Nick Coghlan ncoghlan at gmail.com
Wed Jan 31 22:52:49 CET 2007


Jim Jewett wrote:
> On 1/31/07, Josiah Carlson <jcarlson at uci.edu> wrote:
>> P.S. One of the reasons why I have been pushing for a wrapper, is
>> primarily because I believe that the added complexity to the *base type*
>> is too much, while a wrapper object would be free to do just about
>> anything (with a sufficiently restricted meaning of 'anything').
> 
> What exactly do you mean by a wrapper?
> 
> Are you thinking of something like a 3rd-party library providing a
> string-like object which doesn't claim to inherit from str, and has a
> subtly different API?  That seems to get the bad from both choices,
> and the good from neither.

FWIW, there's prior art for something like Josiah's approach in the form 
of Java's StringBuilder & StringBuffer classes [1].

A mutable container is used to build the string, then converted to a 
normal immutable string when complete (this is similar to the intended 
use of collections.defaultdict, with the default in place during 
initialisation, but removed before the dictionary is given to any other 
part of the program).

Cheers,
Nick.

Cheers,
Nick.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html



-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list