My Python 3 & Python 2 Dual Development Wishlist

I want to use Python 3 in my new Python-based projects. I really do.

It is clear that Python 3 is the future (present?), and is probably the “better language” compared to Python 2. Why not use the newer language?

Raymond Hettinger would probably say that Python 3 allows you to write more beautiful, idiomatic Python. I’m all in favor of that!

These days, I use Python 3 without much thought for small scripts that are intended for personal use, with few dependencies. This works fine, as long as I don’t reach a point that I want to use that library that doesn’t support Python 3, and then it’s a PITA…

If I want to write something that I want to share, on the other hand, choosing Python 3 is not so obvious. I want to use Python 3, because it’s the “Right Thing To Do”. I don’t want to be that “library that doesn’t support Python 3 and is someone’s PITA”. But I also want to have my stuff accessible to the masses that are still working only with Python 2, for whatever legitimate reason they may have. Like this, and to some extent this.

I wish there was an easy way to do just that – write beautiful, idiomatic, Python 3 code, while maintaining Python 2 compatibility.

I want to write beautiful, idiomatic, Python 3, and maintain Python 2 compatibility – it this too much to ask?

Yes, you can say that Six library is a solution for writing dual Python 2 & Python 3 code. But would you argue that it grants my wish for “beautiful, idiomatic, Python 3 code”? If you think it does – please show me some examples!

Maybe you can also claim that 3to2 is a viable solution. I don’t know – I haven’t tried yet with complex real-life use-cases. Have you? Can you say this is a feasible path to take? How well does it handle the newest shiniest Python 3 stuff? What’s the development workflow around it? What do you do to catch and fix the edge-cases it doesn’t handle well, without ruining the original code with version-aware crap?

Are there other viable options? Anyone doing this with a large-scale projects, and is willing to share the approach and experience?

Check Out These Python Podcasts

I recently discovered two new podcasts about Python!

I think both podcasts started about the same time – 3-4 months back. I found out about them a few weeks ago, and managed to catch up on the episode backlog 🙂 .

Both are based on conversations with people from the industry and Python community.

Talk Python To Me is hosted by Michael Kennedy. At the least, check out the show theme music. Beyond that, I enjoyed the technical depth of the conversations. Especially the episodes about Netflix, Flask, and Docker. The production quality is surprisingly good for a young independent podcast.

Podcast.__init__ is hosted by Tobias Macey and Chris Patti. This show could use some nicer production-fu, as much as I enjoy a whispering guest along a shouting host. Many of the conversations on this show are interesting as well, like the one with the Python guys. Personally, I enjoyed the more technical conversations, compared to the culture-themed ones.

If you’re a Python-enthusiast, definitely look into these podcasts!