3 ms·
Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free t
by rubatuga 10y ago
Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free to comment if you aware of any more.
- yeukhon 10y agoI'd add unicode to this. Now the only string type is unicode in Python 3. I think [1] and [2] are good places, not sure if there's an absolutely easy-to-navigate summary from 2-3. [1]: https://docs.python.org/3/howto/pyporting.html https://docs.python.org/3/howto/pyporting.html [2]: http://python-future.org/compatible_idioms.html http://python-future.org/compatible_idioms.html
- kevin_thibedeau 10y agoBytes/Unicode strings is the biggie for anyone doing I/O.
- tempay 10y agoGenerally projects that suffer from the str/bytes/unicode mess is the hardest to port in my experience as 2to3 can't really help. Also relative/absolute imports can cause some confusing bugs.
- xapata 10y agoThat's because the programmer needs to make the choice of whether the data is text or just bytes. I suppose you could write a tool to infer that choice, but it wouldn't be perfectly accurate.
- tyingq 10y agoAnd see if that choice lines up with the v3 compatible version of any libraries they are using. Ones that touch the data anyway.