A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-September/128817.html below:

[Python-Dev] sys.intern should work on bytes

[Python-Dev] sys.intern should work on bytes [Python-Dev] sys.intern should work on bytesBenjamin Peterson benjamin at python.org
Fri Sep 20 15:57:26 CEST 2013
2013/9/20 Jesus Cea <jcea at 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4