[Python-ideas] A python bridge between versions

Steven D'Aprano steve at pearwood.info
Sat Mar 1 05:07:40 CET 2014


On Thu, Feb 27, 2014 at 10:03:42PM -0800, ian o wrote:
> Chris, great reply.
> 
> Yes it is not easy. Especially if you wish to make use of python2 modules 
> painless.
> 
> And I agree wholeheartedly that serious thought is needed on the 'could it 
> work so well that it actually slow the migration of library modules?'.

I think that such a bridge will slow the migration of library modules, 
since it reduces the need to migrate. As a library author, why should I 
spend tens or hundreds of hours migrating my library to Python 3 when I 
can spend 10 minutes adding a note to the library's website telling 
people to use the bridge?

The problem with this suggestion is that it does nothing to encourage 
library authors to migrate to 3, it simply enables them to delay 
migrating even longer, possibly for so long that they lose interest 
altogether.

That's library authors. How about the developers who use those 
libraries?

Right now, there is some motivation for people to move to 3: cool new 
features, and getting cooler by the year. With this suggested bridge, 
they can migrate to 3 while still remaining dependent on 2. This might 
seem like a win if you only focus on the short term uptake of 3, but it 
misses the fact that they're still dependent on 2. They've now *trebled* 
the number of language dependencies, from Python only to two versions of 
Python plus the bridge software.

Having spent the time and effort to migrate to 3, in a few years they'll 
have to go through the same pain again to get rid of the dependency on 2 
and the bridge. Nobody will want to do that. The pressure on the core 
developers to keep supporting 2 forever will increase, not decrease.


> This is an important debate to have.  I suggest if the answer to 'can a 
> specification be created that will significantly accelerate migration?', 
> then it is worth the effort to deliver this.

I think you are making a classic mistake of technically-minded people: 
looking for a technical solution to a social problem.

The problem with Python 3 uptake is not a technical problem, or at least 
not *only* a technical problem. It is mostly a social problem: the costs 
of migrating are greater than the benefits. Python 3 is great, but for 
most people Python 2 does the job.

Another social problem is that the minority of library authors who 
haven't migrated haven't done so because they personally don't care 
about Python 3, or they don't have the time or money to spend on it. 
Adding a bridge doesn't suddenly give them more time or money.

For application developers, the social problem is less because of a few 
libraries and more to do with the supported standard Python on their 
system. That will change once Linux distros start providing 3 as their 
standard system Python; out of the big distros, Fedora is about to do 
so, so things will start changing soon.

But perhaps the biggest reason for slow uptake of Python 3 with existing 
projects is that nobody wants to spend money just to migrate to 3 for 
the sake of migrating to 3. "Written in Python 3" is not a selling 
point. Even the availability of security updates is not much of a 
selling point, although it will become more important when Python 2.7 is 
end-of-lifed. The reality is that many apps work perfectly well now 
using Python 2.7, or 2.6, or even 2.4, and they'll continue to work well 
in five or ten years so there's no real need to update. At the last US 
PyCon, there was even one fellow still using Python 1.5. It works, he 
didn't need security updates, so why migrate?

*This is not a problem to be solved.* It's okay for people to stick with 
an old version of Python. There's no rule that says Python has failed if 
some developers stick to old versions.


> As things stand, the popularity of Python has dropped by most measures 
> since the release of Python 3. Improve the language and lose market share?  
> I suggest that is all about the pain of the transition.

That sounds remarkably like FUD to me. Where is your evidence that the 
popularity of Python has fallen?

Personally, I think all the "language popularity" measures are dubious, 
or at least need to be treated with considerable skepticism. Take this 
one:

http://langpop.com/

which lists BrainF--- in the 40 most popular languages. Sure it is.

The PyPL popularity index here:

https://sites.google.com/site/pydatalog/pypl/PyPL-PopularitY-of-Programming-Language

shows Python as increasing in popularity. In contrast, TIOBE shows 
Python as losing popularity -- but so did Java, PHP, C++ and Ruby, and 
none of them have a major version change. (TIOBE also shows that despite 
a large number, possibly majority, of VB 6 developers boycotting VB.Net, 
VB.Net has just entered the top 10 most popular languages.)

And then there's CodeEval, which for the third year in a row has found 
that Python is more popular than Java, C++, C, PHP and Javascript. In 
fact more popular than Java, C and PHP *together*.

http://blog.codeeval.com/codeevalblog/2014

Bless their little white socks, but methinks their methodology is 
perhaps a tad flawed.

I think it is interesting to compare and contrast these different ways 
of measuring popularity, but then I'm a statistics wonk and I find even 
flawed statistics interesting. Remember that there is no one true 
definition of popularity, even if there were there is no accurate way of 
measuring it, and all of the sites that claim to do so are actually 
measuring subtley different things.

Most importantly, chasing popularity for its own sake is a waste of 
time. What makes Python Python is not just the syntax and std lib, but 
also the culture -- we're neither the stultifying corporate culture of 
"Java shops", nor the wild-west anything goes of cowboy PHP developers, 
but something unique. (As are other languages, of course. Perl culture 
is not Haskell culture is not Erlang culture.) In part, people take up 
languages because they like the culture. Python will never attract the 
corporate suits who like the Java philosophy, nor will it attract the 
cowbody web developers who like the PHP way of doing things. Should we 
try to ape PHP or Java to attract the cowboys or suits? Or should we 
continue to make Python the best language that *we* like, regardless of 
what other people prefer?

Untimately, apart from winning pissing contests on Slashdot and Reddit, 
what does it matter if Python is third most popular or ninth most 
popular? Its not a popularity context where the winner takes all. 
According to TIOBE, the most popular language, C, has less than 20% 
share. If you think Python is a failure because it is in position 8, 
what does that make Javascript in position 9?



> You do not have to search hard to find comments to the effect 'nobody is 
> using python3'.   Or 'even if you use python 3, do not use the new features 
> since you need to ensure code is compatible with both versions'.

You don't have to search very hard to find comments that Elvis was 
kidnapped by aliens.

https://duckduckgo.com/html/?q=elvis+kidnapped+by+aliens

A belief which has rather more going for it than either of the two 
comments you list above, since there's a miniscule, microscopic chance 
that perhaps Elvis *was* kidnapped by aliens, whereas I know for a fact 
beyond any doubt that some people are using Python 3 and using the new 
features.



-- 
Steven


More information about the Python-ideas mailing list