2013/9/20 Jesus Cea <j...@jcea.es>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 20/09/13 15:44, Antoine Pitrou wrote:
>
>> Yes. The main difference is that sys.intern() will remove the
>> interned strings when every external reference vanishes. It
>> requires either weakref'ability (which both str and bytes lack) or
>> special cooperation from the object destructor (which is why
>> sys.intern() is restricted to str instead of working with arbitrary
>> objects).
>
> Great comment. Thanks.
>
> Why str/bytes doesn't support weakrefs, beside memory use?

Is increased memory use for every str/bytes object not a good enough reason?

-- 
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to