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

Licheng Fang fanglicheng at gmail.com
Sat Nov 24 11:35:01 EST 2007


On Nov 24, 9:42 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> On Sat, 24 Nov 2007 13:40:40 +0100, Bjoern Schliessmann wrote:
> > Licheng Fang wrote:
> >> On Nov 24, 7:05 pm, Bjoern Schliessmann <usenet-
>
> >> 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?
>
> AFAIK strings of length 1 and strings that would be valid Python
> identifiers are treated this way.
>
> Ciao,
>         Marc 'BlackJack' Rintsch

Thanks. Then, is there a way to make python treat all strings this
way, or any other kind of immutable objects?



More information about the Python-list mailing list