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/128807.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 bytesAntoine Pitrou solipsis at pitrou.net
Fri Sep 20 14:15:51 CEST 2013
Le Fri, 20 Sep 2013 13:19:24 +0200,
Jesus Cea <jcea at jcea.es> a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> """
> sys.intern(b'12121212')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: must be str, not bytes
> """
> 
> I wonder why.

From http://docs.python.org/3.3/library/sys.html#sys.intern

"""sys.intern(string)

    Enter string in the table of “interned” strings and return the
    interned string [...]"""


In Python 3 context, "string" means "str".

Regards

Antoine.


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