Namespaces for the Python Package Index
Namespaces for the Python Package Index
Posted May 5, 2023 2:25 UTC (Fri) by NYKevin (subscriber, #129325)In reply to: Namespaces for the Python Package Index by mathstuf
Parent article: Namespaces for the Python Package Index
No, it was even dumber than that. Python had "narrow" and "wide" builds, which used UCS-2 and UCS-4 respectively (i.e. the language was not aware of surrogate pairs and treated them as two characters). To a first approximation, the Windows builds were narrow and the Linux builds were (mostly) wide (and I have no idea what they did for macOS).
This was all cleaned up in Python 3. Now, strings are sequences of abstract code points, and the encoding is an internal implementation detail. If you want to use "bytes encoded in UTF-8" instead, you can easily do that, but it's just not what the language does by default.