zlacker

[parent] [thread] 2 comments
1. JoshTr+(OP)[view] [source] 2025-12-06 22:26:33
That distinction is indeed critical, and I'm not suggesting removing that distinction. My point is that you could give all those types names, and manage the transition by having Python 3 change the defaults (e.g. that a string is unicode).
replies(1): >>kstrau+M
2. kstrau+M[view] [source] 2025-12-06 22:32:37
>>JoshTr+(OP)
I’m a little confused. That’s basically with Python 3 did, right? In py2, “foo” is a string of bytes, and u”foo” is Unicode. In py3, both are Unicode, and bytes() is a string of bytes.
replies(1): >>JoshTr+Er
◧◩
3. JoshTr+Er[view] [source] [discussion] 2025-12-07 03:15:39
>>kstrau+M
The difference is that the two don't interoperate. You can't import a Python 3 module from Python 2 or vice versa; you have to use completely separate interpreters to run them.

I'm suggesting a model in which one interpreter runs both Python 2 and Python 3, and the underlying types are the same, so you can pass them between the two. You'd have to know that "foo" created in Python 2 is the equivalent of b"foo" created in Python 3, but that's easy enough to deal with.

[go to top]