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

Licheng Fang fanglicheng at gmail.com
Sat Nov 24 05:36:25 EST 2007


I find myself frequently in need of classes like this for two reasons.
First, it's efficient in memory. Second, when two instances are
compared for equality only their pointers are compared. (I think
that's how Python compares 'str's.

On Nov 24, 6:31 pm, Licheng Fang <fanglich... at gmail.com> wrote:
> I mean, all the class instances that equal to each other should be
> reduced into only one instance, which means for instances of this
> class there's no difference between a is b and a==b.
>
> Thank you.




More information about the Python-list mailing list