How can I create customized classes that have similar properties as 'str'?

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sat Nov 24 07:40:40 EST 2007


Licheng Fang wrote:
> On Nov 24, 7:05 pm, Bjoern Schliessmann <usenet-

>> BTW, what happens if you, by some operation, make a == b, and
>> afterwards change b so another object instance must be created?
>> This instance management is quite a runtime overhead.
> 
> I probably need this class to be immutable.

IMHO you don't need a change of Python, but simply a special
implementation (probably using metaclasses/singletons).
 
> Wow, I didn't know this. But exactly how Python manage these
> strings? 

I don't know (use the source, Luke). :) Or perhaps there is a Python
Elder here that knows?

Regards,


Björn

-- 
BOFH excuse #165:

Backbone Scoliosis




More information about the Python-list mailing list