News for hackers. Stuff that matters.
Re:Speed improvements in Python 3.7 by singularity2001 on Wednesday February 14, 2018 @02:51AM (#16374236)
print(str(b'I am a broken string'))

print(str(b'I DONT WANT TO add "UTF-8" everywhere!!','UTF-8'))

not quite default!

Re:Speed improvements in Python 3.7 by orf on Wednesday February 14, 2018 @04:58AM (#16374742)
Explicit is better than implicit. The first line isnt a string, it's a collection of bytes, guessing that it's utf8 is not the right thing to do.

The encode (or is it decode? I always forget) defaults to utf8, which is what you should be using.

Re:Speed improvements in Python 3.7 by Siecje on Wednesday February 14, 2018 @08:56AM (#16375680)
It helps me to think encrypt for encode (convert to bytes) and decrypt for decode (convert to text).
Re:Speed improvements in Python 3.7 by viraptor on Wednesday February 14, 2018 @05:07AM (#16374781)
I'm not sure why this example is interesting. You can write:

print('I DONT WANT TO add "UTF-8" everywhere!!')

And get the same result. Or if you really want to start with bytes:

print(b'some string'.decode())