5 ms·
this is incredible - give me unicode support in python 2. asyncio ? probably .. i'll still be happy with gevent. This is a clear path for a python upgrade.
by sandGorgon 10y ago
this is incredible - give me unicode support in python 2. asyncio ? probably .. i'll still be happy with gevent. This is a clear path for a python upgrade.
- orf 10y agoPython 2 supports unicode and asyncio.
- sandGorgon 10y agoi know it does - but it would be nice to have the everything-is-unicode mechanism of python 3. Asian developers hit unicode problems before US based developers because of the natural differences in underlying OS language.
- lloeki 10y agoBut then it wouldn't be compatible with Python 2 code, so you might as well use Python 3
- sandGorgon 10y agohttp://python-future.org/unicode_literals.html http://python-future.org/unicode_literals.html nope - you can mix them in python 2 code. The way it should have been done in the first place.
- orf 10y ago... You can't have your cake and eat it. If you want Unicode everywhere then you use Python 3, because it's a breaking change. Saying you'd want it in Python 2 is a confused way of saying "I need to use Python 3".
- masklinn 10y ago> give me unicode support in python 2 Nope. Can't be done without getting Python 3 either way, because Python 3's text model is not compatible with Python 2's. That is why the core team allowed the other breaking changes, because software was going to be broken in the first place.
- sandGorgon 10y agonot entirely true - http://python-future.org/unicode_literals.html http://python-future.org/unicode_literals.html it's not 100% seamless, but its almost there.
- smallnamespace 10y ago> Changing to `unicode_literals` will likely introduce regressions on Python 2 that require an initial investment of time to find and fix. The APIs may be changed in subtle ways that are not immediately obvious. Unless you're willing to put in the time and energy to extensively test, this is basically a recipe for disaster. You're basically paying at least 80% of the cost of a full Py2 -> Py3 port (since looking for regressions is a huge part of that cost), for only a fraction of the benefit.
- dagss 10y agoBeing able to change things in one part of the code base at the time -- or one feature/data field at the time, is a HUGE thing. For production systems you just cannot put the backlog on pause for a month or two while porting. You can however incrementally fix over the course of some years.
- smallnamespace 10y agoThat's probably true, but unicode_literals isn't the right tool to make an incremental port, because it neither obeys good py2 nor py3 text handling conventions. It would become a substantial detour and end up being a kit more total work. Also, porting can be done in parallel to normal dev. You aim your port at a specific release while you continue fixing bugs. When the port is done, you port over all the patches. Repeat until port and original version converge.
- dagss 10y agoIsn't it as simple as a) do proper string handling in py2 unicode and b) if you write more u"" in a file than "", flip the switch and write "" and b"" instead?
- ubernostrum 10y agogive me unicode support in python 2 If by this you mean "give me exactly Python 3's text model without breaking my unmodified Python 2 code", you should be aware that A) this is impossible because B) the Python 3 text model is backwards-incompatible with unmodified Python 2 code, and C) that's kinda why Python 3 existed and was backwards-incompatible.