News for hackers. Stuff that matters.
Re:GIL Become Optional in Python 3.13 by mort96 on Monday August 12, 2024 @05:47AM (#41222773)
I mean I do think Python 3 introduced some pretty bone-headed things. Their strings are horrible if you need to interact with the system. Most system APIs on UNIX-like systems don't promise that anything is UTF-8-encoded, so you can't e.g use strings to store paths. You need to use byte strings, and they have WAY worse ergonomics in many ways than strings.

I would never use Python 2 now, but I do understand why some people would choose 2 back when 3 was new (and even slower than 2!).

Re:GIL Become Optional in Python 3.13 by robertlagrant on Monday August 12, 2024 @06:42AM (#41223031)
> so you can't e.g use strings to store paths. You need to use byte strings, and they have WAY worse ergonomics in many ways than strings

Would you not use Pathlib?

Re:GIL Become Optional in Python 3.13 by isjsndn on Monday August 12, 2024 @06:47AM (#41223053)
But isn't exactly that the reason for the string/byte split?

Rust has a similar thing with OsStr. In my opinion a clear type based separation between different kinds of strings (Text, data, os path, ...) is just required to write robust softwsre