The greatness of Python would have been impossible without rejecting virtually all feature requests. To move the vision of Python forward, it was necessary to depart with old syntax.
Python 3 is happening. Deal with it.
The greatness of Python would have been impossible without rejecting virtually all feature requests. To move the vision of Python forward, it was necessary to depart with old syntax.
Python 3 is happening. Deal with it.
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.
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.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.
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).
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.
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.
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...
One does not see such amount of discussions regarding other languages that suffer even bigger transitions problems.
Java is now version 8, still there are lots of places having to deal with versions 4 and 5.
.NET is getting 4.6/5 version in the upcoming months, still many enterprises still have version 3.5 code bases.
Everyone is discussing the benefits of C++14, while many corporations still use pre-C++98 like code.
Yet in the Python community it is such a big deal.
http://www.oracle.com/technetwork/java/javase/8-compatibilit...
Breaking changes in Java 7
http://www.oracle.com/technetwork/java/javase/compatibility-...
Breaking changes in Java 6
http://www.oracle.com/technetwork/java/javase/compatibility-...
Breaking changes in Java 5
http://www.oracle.com/technetwork/java/javase/compatibility-...
Breaking changes in all Java versions up to 1.4
http://www.oracle.com/technetwork/java/javase/compatibility-...
I no longer remember which version it was and don't feel like going through those lists now, but I remember one of those versions changed some JDBC interfaces which would break any application using JDBC.
Python had its share of breaking changes as well over the years and there wasn't much fuss about them. Who refused to upgrade over class name(object) or say hex(-1) producing '-0x1' instead of '0xffffffff'?
lol wut? How exactly does adding a method to a JDBC interface "break any application using JDBC"?
Maybe I should have written extending the JDBC classes instead.
Just like nobody walks around and complains that new versions of the servlet API break any Java web application because web applications are not supposed to implement the servlet API. That's the job of the server.
Another use case, many developers mock JDBC by creating their own dummy drivers, specially in large companies where mocking libraries are frown upon.
Nope, they are database specific.
So we went from "would break any application using JDBC" to large company rolling their own database drivers for reasons that can't be disclosed (probably to protect the guilty).
> as it was the case in the application I had to fix. Why it was made so, will be kept under the covers of the NDA agreement.
Standard case of a large company doing it wrong and blaming somebody else when it comes back to bite them rather than fixing it. And hiding behind an NDA. Seriously what was the expectation? That JDBC never changes? Because at that time JDBC was already at version 3.0 which is obviously the final version after which no features would ever be added again.
> Another use case, many developers mock JDBC by creating their own dummy drivers, specially in large companies where mocking libraries are frown upon.
If you're doing it wrong then you're doing it wrong. Nobody to blame but yourself. Just because you're a large company doesn't make it right. Part of why it's wrong is that it will come back and bite you later on. And that's the problem in this case? The compiler tells you where you need to implement which methods.
Two give you two other examples. Interfaces for HTTP likely need to be updated when something in HTTP changes (WebSockets, HTTP/2). Servers implementing this will need to be updated to implement this. You don't accuse the language of the web server to make a breaking change. That's just how these things work. Same for SSL/TLS features like SNI. Sure it could be that you absolutely have to run your own web server or SSL/TLS implementations for reasons that you can't disclose because you're under an NDA. But then you expect that you'll have to maintain them and add additional features, don't you?
Ruby 2.0 had similar levels of incompatibility; I think people simply didn't have those large enterprise codebases in Ruby to make a fuss about.
Java, .net and C++ go to extreme efforts for backwards compatibility, compromising their current/future versions as a result.
True, but they still introduce breaking changes as well.
I just posted all the Java release notes in a sibling post, and could do the same for .NET and C++.
Maybe the amount of breakage isn't as big as Python 2 -> 3, but it does happen.
Moving a large codebase to v3 is expensive for almost no benefits? Some parts of the community already moves on to Go, etc. Many third party libraries are v2 only and unmaintained. Many languages that broke backwards compatibility ultimately failed (their community moved on) or split their community. Examples: Modula 2/3/Oberon4, Perl 4/5/6, Lua 5.1(LuaJIT)/5.2, Visual Basic 6/.Net, QBasic/Visual Basic 1, VBA/VBA.Net, J++/J.Net/C#, etc.
Fibers and coroutines are key features of certain language and API's for decades. WinAPI16 had already Fibers (MS Word), Lua's coroutines, Go's goroutines, etc.
Also Oberon had a different purpose than Modula-2.
In Oberon's case, you have actually Oberon, Oberon-2, Component Pascal, Active Oberon, Zonnon and Oberon-07.
It is not the same as the next version of a given language, rather different approaches how to design memory safe languages for systems programming.
my standing question in the debate has always been what is the big deal with having built a robust 2to3 preprocessor?
i figure if you make a change to the spec migrating existing code to the new syntax should be a pretty straight forward ifttt, something that should be a necessary addition to the change, a la tests
knowing full well 'pretty straight forward' is the bane of all software endeavors could anyone explain to me what is going on within the scope of 2to3 preprocessors?
and why such preprocessors seem an impossible boon very few, except a handful of seeming independants, endeavor
Shame on the community for not learning the lessons of Perl. Fragmentation is far worse than an imperfect language.