Jim Jewett wrote:
> On 1/31/07, Josiah Carlson <[EMAIL PROTECTED]> 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   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
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