|
|
Log in / Subscribe / Register

Python 3: threat or menace? (O'Reilly)

Python 3: threat or menace? (O'Reilly)

Posted Sep 27, 2014 4:11 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
In reply to: Python 3: threat or menace? (O'Reilly) by raven667
Parent article: Python 3: threat or menace? (O'Reilly)

Answer: it's a mess, actually. There's a special variable PYTHONENCODING, then there's logic to get it from the normal environment. And don't get me started on Unicode on Windows. And I still don't understand what advantages we get out of it.

I'm really glad that modern languages like Go and Rust did not go down the rabbit hole with a magic 'unicode' type that leaks all over the place but instead simply provide convenient utilities for UTF-8 encoded strings.


to post comments

Python 3 mess

Posted Sep 28, 2014 21:11 UTC (Sun) by man_ls (guest, #15091) [Link]

Thanks for the explanation. I have often criticized Python 3 changes for breaking backwards compatibility, but did not evaluate the changes themselves. Everyone spoke so highly of the new Unicode strings that I had not actually stopped to look at the problems that they were supposed to solve; which to me could already be solved in a different way, but anyway I just trusted the "voice on the street".

I'm glad I don't have to worry about it any more. Just so you people can vilify my opinion, I'm quite happy with server-side JavaScript, as I never thought I would. Stockholm syndrome I suppose...

Python 3: threat or menace? (O'Reilly)

Posted Sep 29, 2014 16:32 UTC (Mon) by Wol (subscriber, #4433) [Link]

Sounds like Guile2!

If you want to read a utf-8 string into a utf-8 variable you can NOT guarantee that the string that ends up in your variable is the string that was read in!!!

It force-feeds it through the encode/decode system, and the translation is not guaranteed to be 1<->1 !?!?! Which plays havoc with lilypond - a project I'm interested in.

Cheers,
Wol

Python 3: threat or menace? (O'Reilly)

Posted Sep 30, 2014 11:58 UTC (Tue) by sorokin (guest, #88478) [Link]

> I'm really glad that modern languages like Go and Rust did not go down the
> rabbit hole with a magic 'unicode' type that leaks all over the place but
> instead simply provide convenient utilities for UTF-8 encoded strings.

Completely agree. Between UTF-8/-16/-32, UTF-8 is the only sensible solution. The good link about technical details of why UTF-8 is preferred is http://utf8everywhere.org/


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds