4 ms·
I'm wondering, can't existing Python 2 software be automatically converted to Python 3? It might be ugly at times, but still better then vulnerable...
by blauditore 6y ago
I'm wondering, can't existing Python 2 software be automatically converted to Python 3? It might be ugly at times, but still better then vulnerable...
- giancarlostoro 6y agoThey have had conversion tools for it since the early days of 3. The issue is it wont get everything.
- jimhefferon 6y agohttps://docs.python.org/2/library/2to3.html https://docs.python.org/2/library/2to3.html
- Groxx 6y agoTo join in the other comments here: because it's not safe to do so automatically. There are semantic changes to the language that do not have automate-able solutions. E.g. how strings/unicode/bytes work, to name just one.
- harikb 6y agoThey exist, but Python, being a dynamic typed language, at least by default, runs a higher risk in automated conversions. Just because it compiles after conversion doesn’t mean it isn’t broken. Unless the code base has a very very good set of unit tests, which is unlikely in practice, it is very risky to do automated conversions. Whereas the same situation with Java, Go, Rust etc would be slightly better. Sure you would still have bugs but lower probability.