[Python-Dev] sys.intern should work on bytes
Jesus Cea
jcea at jcea.es
Fri Sep 20 15:54:48 CEST 2013
-----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?
- --
Jesús Cea Avión _/_/ _/_/_/ _/_/_/
jcea at jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
Twitter: @jcea _/_/ _/_/ _/_/_/_/_/
jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQCVAwUBUjxTqJlgi5GaxT1NAQIbvwP/fs7e5MJwF0pCa0NObTx0xN8CFQIX9/jt
VkQ1Q7lPLSuRlZMC2B+0xfp9QoAsD6N3xqSXwG+T9uf7w6nZ9y3keI06kAdSn/Cz
D8EyxoeuNk2aGq0VIzMO260mgs9Gr+3DtWAROcWCMG+8sr5uekJ/LAhI04/xMkqZ
zr7aOy1xDgk=
=hzGP
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list