But more importantly, keep in mind that many academics move on to a new institution every couple of years (after finishing undergrad/Ph.D./post-doc, etc.), so any code written more than 5 years ago likely has no maintainer and no one in the lab knows how it works.
Very true, but this happens regardless of whether it was Python2.x, Python3 or MATLAB code.
The problem is that many academics writing scientific code rarely have the training/education/experience to write maintainable code (if you feel this does not apply to you, you are probably the exception, and if you ever shared code with colleagues, you are aware how rare your skill is in academia). Also most of it is or started out as, quick experiments, try-outs, for that, and some other (even political) reasons, there is not a lot of incentive to write beautiful maintainable code.
But then again, a lack of reproducibility sometimes seems to be what it takes to succeed in Academia...
My dad is a chemist, and I recently learnt that some Fortran code he wrote in the nineties is till being used in academia.
Try to explain to his colleagues that you need an on-site engineer to maintain python code just a decade old.
Anyhow, while I disagree with the need of a dedicated engineer to port code to python3, porting isn't much of a big deal. If your dependencies work (eg: your libraries are python3-compatible), most of you work is done by 2to3. Very little effort is needed after that.
The problem up to now, has been waiting for you dependencies/libraries to achieve python3-compatibility (recursively, of course). But we've already moved past that.
I highly doubt that "End of life" means you can't get it to run anymore.
https://pypi.python.org/pypi/python-bond
> You can freely mix Python versions between hosts/interpreters (that is: you can run Python 3 code from a Python 2 host and vice-versa).
For the people that are stuck with Python 2 legacy code, we'd need something else.
Python-future [1] seems to be able to import some Python 2 modules, but I'm not sure how far it goes.
>>> print "hello"
SyntaxError: Missing parentheses in call to 'print'
If it can print a SyntaxError explaining the problem then it can print "hello".The only snag is that a tuple would be printed slightly differently, but that is harmless.
People should be upset that a new release of Python breaks their code, because the Python developers acted unprofessionally in expecting all python code in existence to be rewritten to suit their aesthetic fetishes.
You're really foolish if you believe that's better. The print keyword isn't what is preventing 3k adoption.
You might be able to require parens for methods with no arguments, but optional parens with arguments. It might require some clever hacks in the parser, but I suspect it's possible. The bigger question is whether or not the result would be Pythonic.
len flurp
to quickly get the length of an array.
I know this is just the situation in my corner, and that it looks rosier for other users - e.g. for web development, system administration, etc..
The thing is, we have decades worth of legacy code - large libraries and small config scripts - that no one is going to rewrite. All python versions up till 2.7 were mostly backwards-compatible, and we came to depend on that. That the changes towards 3.x were breaking seems totally unneccessary (except for the string/unicode thing), which also gives it a psychological component in my opinion. Give us back the stupid print statement, and I bet this alone will massively increase adoption.
And if someone makes a patch to Python to import a Python 2 module in Python 3 (old syntax, old str/unicode, and a copy of the old stdlib - and it doesn't matter if it is 10% slower or never gets merged upstream), I'd be willing to pay $$ for it.