$ cat main.py print (u"Hello " + b"World!"); $ python2 main.py Hello World! $ python3 main.py Traceback (most recent call ast): File "main.py", line 1, in <module> print (u"Hello " + b"World!"); TypeError: Can't convert 'bytes' object to str implicitly
2 comentarios:
Why do you think adding a blob of arbitrary binary data to a wellformed Unicode string should be a wellformed operation?
Thomas: I don't :) I like what what was changed from Py 2 to Py 3.
Publicar un comentario