Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Two quick notes, probably well-known in the Python community, maybe less so outside:

1. The biggest hurdle to overcome when moving existing code bases to Python 3 (affectionally known as py3k) is third-party libraries. This is the main reason why there is some pressure on library authors to move their libraries to Python 3. Cf. https://python3wos.appspot.com/ for some (very encouraging, IMHO) results.

2. It's possible, in many cases, and without two much effort, to write (or refactor) code that is compatible with both Python 2 and Python 3. One great tool for this is the python-future project:

http://python-future.org/

Cf. in particular: http://python-future.org/compatible_idioms.html

In some cases, it's even simpler. Flask, for instance, achieves it with a small 55 LOC module: https://github.com/mitsuhiko/flask/blob/master/flask/_compat...

One last great resource is Lennart Regebro's book: http://python3porting.com/



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: