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/2011-December/114802.html below:

[Python-Dev] readd u'' literal support in 3.3?

[Python-Dev] readd u'' literal support in 3.3?Barry Warsaw barry at python.org
Fri Dec 9 04:38:16 CET 2011
On Dec 08, 2011, at 06:53 PM, Guido van Rossum wrote:

>Are you saying that with that future import, b"..." is still a Unicode
>literal?

No, the future import has no impact on b-strings.

-----snip snip-----
from __future__ import print_function
import sys
print(sys.version_info.major, sys.version_info.minor, type(b''))
-----snip snip-----

$ python /tmp/foo.py
2 7 <type 'str'>
$ python3 /tmp/foo.py
3 2 <class 'bytes'>

-----snip snip-----
from __future__ import print_function, unicode_literals
import sys
print(sys.version_info.major, sys.version_info.minor, type(b''))
-----snip snip-----

$ python /tmp/foo.py
2 7 <type 'str'>
$ python3 /tmp/foo.py
3 2 <class 'bytes'>

Cheers,
-Barry
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