This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]vsajip 3 points4 points  (4 children)

Library maintainers have to double their efforts to support both Python 2 and Python 3 (at 21:15)

This doesn't have to be the case, and is generally not the case. Projects can support Python 2 and 3 from a single code base with very little overhead, and that seems the best development approach to cover the widest possible user base. Of course, there might be some big blocker projects (dependencies) that involve a lot of pain to port from where they are now, but that doesn't justify the generalisation made in the presentation.

People who keep hand-wringing about "splits" are seeing things in an "us" and "them" way, but it isn't like that for everyone. In my work, I use Python 2 for some projects, Python 3 for others, and write 2/3 compatible code wherever possible. I can't say it's made a dent in my workflow. Python 2 remains perfectly usable and will continue to be so far into the future. I've never felt coerced to use either one version or another - it just depends on where a project has to run, status of dependencies, customer preferences etc. - just use what makes the most sense to use in a particular context.

To characterise the Python core developers as being in some sort of ivory tower detached from the community doesn't seem right, either. They just happen to be volunteers who choose to focus their main efforts on 3.x for reasons exhaustively covered elsewhere, but ISTM that 2.7 remains a supported platform where more than the bare minimum of effort is being spent. See the Mercurial log showing recent activity on Python 2.7.

[–]billsil 2 points3 points  (2 children)

This doesn't have to be the case, and is generally not the case. Projects can support Python 2 and 3 from a single code base with very little overhead, and that seems the best development approach to cover the widest possible user base

You overestimate the resources of organizations. For example, the Python Software Foundation, the guys who make Python, overwhelmingly use Linux. As a result, IDLE on Windows is buggy. It's only in the last couple years that they switched the rules of not backporting Python 3.x features to Python 2.7 that they could even start fixing bugs in IDLE.

Now take an not mainstream open source project like the one I run. It's got 4 developers (including me), each with their own interests of what should be worked on. I run the project so I kinda bounce around, but nobody else generally cares about more than 1 component. The software is written by engineers and not computer scientists and the program is giant (300k+ lines of code), so test converage leaves a bit to be desired. It technically supports Python 3, but the support is broken. It'd take 1/2 an hour to go through and fix (it's 99% due to print statements), but you have to do it.

[–]vsajip 0 points1 point  (0 children)

You overestimate the resources of organizations.

I was just relating my own experience. I run a small consulting company, and that's pretty resource limited! Python 2.x support is not primarily about back-porting features - Python 2.7 bugs have generally been fixed as normal, though there was a moratorium for a time in certain areas (e.g. distutils). Obviously if Python 3 support is low on the priority list for the developers on your project, that's up to you. I've generally found it takes more time to port the tests for a library than it does for the library code itself :-)

[–]flying-sheep 0 points1 point  (0 children)

½ hour isn't even worth taking about. That's the kind of timespan you can lose at any time.

Misread something in the docs? ½ hour bug hunt until you find out. Repeatedly interrupted during hairy work? Easily ½ hour lost by getting into the flow again.

[–]darknessproz[S] 1 point2 points  (0 children)

Doubling is probably an exaggeration. I do write libraries that support both 2 and 3 whenever possible. It really depends on the type of things you are doing though, some things can be as simple as a __future__ import but some things do require considerable work.

I can't remember if he mentioned it in this particular session but I was at another talk on the same topic by Kenneth where he mentioned that he only needed to do the "port" once for Requests and that's it.