[Python-Dev] sys.intern should work on bytes (original) (raw)
Victor Stinner victor.stinner at gmail.com
Fri Sep 20 14:04:11 CEST 2013
- Previous message: [Python-Dev] sys.intern should work on bytes
- Next message: [Python-Dev] sys.intern should work on bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2013/9/20 Jesus Cea <jcea at jcea.es>:
""" sys.intern(b'12121212') Traceback (most recent call last): File "", line 1, in TypeError: must be str, not bytes """
I wonder why.
Intern strings optimize dictionary lookup. In Python 3, most dictionaries use str keys (ex: dict of classes).
What would you be the use case of interned bytes objets?
Victor
- Previous message: [Python-Dev] sys.intern should work on bytes
- Next message: [Python-Dev] sys.intern should work on bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]