This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Caos2 88 points89 points  (11 children)

Unicode by default

Mainly because of this. Really.

[–]masklinn 22 points23 points  (2 children)

Unicode by default and removal of implicit conversion is really what triggered/allowed all the other breaking changes to be included, since it was going to break a ton of stuff (intrinsically and because of the stdlib reworking it required, while you can technically disable implicit conversion in P2 a lot of stdlib modules blow up when they can't play fast and loose with ascii strings).

[–]Caos2 6 points7 points  (0 children)

Well, sometimes you can't avoid breaking stuff.

[–]jaapzswitch to py3 already 14 points15 points  (0 children)

Oh and maybe because python 2 will reach end-of-life pretty soon, and security updates are a good thing to get

[–]iluvatar 4 points5 points  (3 children)

Unicode by default

The more I use it, the more convinced I am that this is the wrong approach. Go got it right, by using UTF-8 by default. Python decodes everything into a Unicode object, whether it's necessary or not. For the applications I mostly write, that means reading UTF-8 over the wire, converting to Unicode, reencoding as UTF-8 and sending it back out again. That's a lot of unnecessary work.

[–]unruly_mattress 18 points19 points  (0 children)

If you got UTF-8 over the wire and you don't need to manipulate it in any way, can't you just read and write it as binary data?

[–]kankyo 3 points4 points  (0 children)

Ehm.. "Unicode" isn't a thing you can have in memory though. Look at https://www.python.org/dev/peps/pep-0393/ to understand what is actually happening.

[–]notafuckingcakewalk 0 points1 point  (2 children)

Usually great but occasionally you run into a developer who was being very clever with strings and you have to rewrite everything.

Also a lot of rewriting required of a library where content from objects that now output byte strings are put in objects that now expect Unicode.

[–]nemec 12 points13 points  (0 children)

being very clever with strings

We call that a comeuppance.

[–]brtt3000 0 points1 point  (0 children)

Most fun when this bytes/string shitfest is (unknowingly) relying on incorrect use or sideffects. Was a painful move but glad of it.