228 points · by sebg · 12y ago · 298 comments
In reality, Python 3 is to Python 2 what Ruby is to Python 2 - different. They aren't the same language, you could have named Python 3 Anaconda (just because Cobra is already taken, I know it is a prepackaged library bundle for Python already) and its function would be clearer.
But you also can't tell people writing free software "no, you have to stop doing what you want, and do what I want" unless you are willing to negotiate how much that will cost you. And maybe they wouldn't do it for any price. You could get other developers to extend it on your doll as well.
But the developers of Python collectively said "unicode is important enough to make a backwards incompatible leap". They are never painless. OpenGL is a great example, with how the version 3 line was rife with attempts to depreciate the fixed function legacy cruft, and even today few developers properly differentiate compatibility and core profiles. That is a major version break too.
But if you don't like it, you can make your own. The fact there isn't a major popular python2 extension project trying to backport functionality unofficially that has gained traction should say what the popular consensus on python 3 is.
If you need python2 libraries, use python2. There is really no shame in doing it. Even when the official project depreciates the maintenance of 2.7 someone will pick it up, because there will be for decades, at least, and probably for eternity, python 2 software running somewhere and the maintainers think keeping python 2 working is less effort than porting their stack to 3.
Nor do they like it, because most if not all developers are using these languages for a practical purpose: to get things done. Having to relearn and "fix" things which otherwise wouldn't need to be has a cost, and this is on top of what they already have to do.
I personally think backwards compatibility and gradual change - evolution, not revolution - is the way to go. Outside of the software industry this is the norm; think of all the "interfaces" that we use in the physical world that have remained backwards-compatible and relatively stable over long periods of time. Software is different because it can change quickly and (by itself) easily, but just because it can doesn't mean it should, as if it is well-established, there is certainly a large number of dependencies on it too.
I'm gonna guess that you're not new to C++. I say new because people who have been following it and picking up all the changes along the way often can't see the forest for the trees. That forest is ugly.
And now, modern C++11/14 doesn't look anything like C++03. Which is a blessing and a curse - they effectively depreciated a huge swathe of old practices for better new ones (refs over pointers, smart constructs over raw new / delete, lambdas and auto over void* function pointers, soon were going to have concepts and static if instead of preprocessor ifdefs).
But that comes with a price. The price is that C++ is huge, the compilers are slow due to the complexity, and it is really analogous to per project technical debt.
D exists because C++ was too slow. Walter (and Andre) saw this huge shortfall in standard C++03 and this entire class of functionality that should be there, because it doesn't have a performance overhead, but wasn't. Maybe they also saw how C# and Java were useful and popular, but they put this massive VM under them to simplify the implementation and standardization.
Go exists because C++ was too big - for its purpose, of web server development, you wanted native performance with natural asynchrony and multi processing. It still doesn't have generics because it is pretty much a domain language, I think.
Rust exists because C++, in the wake of C++11, is still a complicated mess of syntax. And in order to maintain backwards compatibility, C++ is terribly unsafe and every line of code can destroy your program. I think Rust is as close to the future of native languages, because it does the C++ thing - a general purpose language, where everything is deterministic and predictable because it is direct binary translation between language constructs and assembler with limited magic - and does that backwards compatibility break to fix the significant flaws.
I still don't like the Rust syntax much, but it might one day grow on me. I don't think its really approachable though, I'd definitely be interested in trying a "pythonic" static typed language that emphasizes safety and productivity while maintaining the poster C++ ideology of providing reasonable abstractions that don't hide the details, but let the expert more intuitively interact with them.
It would solve most of the problem, while encouraging a switch to the new'er version by forcing every user to type in "import from deprecated" in top of their script.
I just think they didn't want to do that, given the massive work and non-existent personal gain. However, any company that want to invest their money on it can since its open source.
If it only where for unicode, the problem would not so big. But they seemed not to bother at all about backwards compatibility at all in the first Py3 version. Later, they did try to change some things, that unnecessarily(!!) blocked adoption, but many projects already decided to ignore Py3.
I guess, you don't mean what you said in the last paragraph? Was it just a joke?
Unless you can replace all libraries that exist only as Python 2 version, you can not move -- you can use zero Python 3. That is a huge problem to real projects -- of course, if you only have some University (educational) - projects, all is fine and you can play around as you like.
Also there is the problem, that it is not trivial to have Python2+3 on the same installation. Most Linux distros still run with Py2.
Actually, it's trivial nowadays with projects like pyenv. You can even have different python versions in a per-project-directory basis.
Check out the installation guide (https://github.com/yyuu/pyenv#installation) and a commands reference (https://github.com/yyuu/pyenv/blob/master/COMMANDS.md)
There's also an extension that provides virtualenv integration - https://github.com/yyuu/pyenv-virtualenv
I must admit, that I did not think to much about it until now, but normally there is only /usr/bin/python in the scripts.
Of course, if everybody has /usr/bin/python3 inside his Python3 programs, everything could work (unless some of your apps need special environment vars like PYTHONPATH, what could make it troublesome again).
But still, the standard installation of Debian (and others, as much I know) does not include Python3 by default, you at least have to add it to your installation. That is something, you must tell your customers, when you ship Python3 programs.
Actually, the name really is taken and by programming language: http://cobra-language.com/ - looked nice when I last looked.
I didn't know about Cobra Toolbox, however.
>Actually, the name really is taken and by programming language: http://cobra-language.com/ - looked nice when I last looked.
The Cobra language does look interesting [1]. Checked it out a little a few weeks ago. I think it only runs on .NET and Mono, though.
[1] It uses ideas from several languages, including Python. On the Cobra site, there are a few short comparisons between it and other languages, including Python:
http://cobra-language.com/docs/python/
Also, it has a feature similar to Design By Contract like Eiffel does:
http://cobra-language.com/docs/quality/
Cobra is worth a look, and keeping eye on as it evolves, IMO.
It generally looks quite nice for a niche language and it's nice that it seems to be maintained. It seems that there is a JVM underway, by the way. Boo was the other similar, interesting language I checked out some time ago, but it seems to be under less active development (if at all).
Anyway, if Python 3 is such a problem, then maybe let's port everything over to Cobra. It has snake in the name and familiar syntax and lots of goodies; imagine how far it could get if hundreds of thousands Python users would start working with it! (Just joking, although I'm wishing Cobra (and all other new or unpopular) languages the best of luck, of course)
This sort of thing isn't uncommon... I see old perl installs behind production software, ancient versions of RedHat, Oracle, etc. and I deal with mostly technology centric companies so that's likely just the tip of the iceberg. Old software doesn't really go away.
Numpy seems to be the biggest issue for most, but I guess it must be in some special area, I never found a need for it doing web development.
The unicode support removes so many of our problems, although I can understand the issues strings vs. bytes that a some people run into.
Numpy was ported to python3 years ago. It was one of the first libraries who rolled up their sleeves and did the work for the good of the python community. I even helped with this, so I know first hand.
Python3 finally cleanly separates the concepts of a "byte" (8 bits) and a "character" (which now is an abstraction). A String is now a collection of characters and no longer functionally equivalent to an array of bytes.
This change is normally welcomed by people who have to deal with multiple languages and encodings anyway, as making the conceptual difference between a character and a byte explicit makes dealing with text much easier. However, if you were used to thinking of strings as byte arrays and not as "the data type for text", you might have a hard time.
But it's basicly Python three killing of the byte-string and ignoring the fact that in some cases it actually makes sense to work with string that are specifically not unicode, rather than resorting to have a bytes type instead.
The problem for me with python is more general as just python 2 vs 3. It's that python seems stuck in the purely dynamic typing side of PL whereas the trend now (golang, haskell, dart , typescript) seems to be that types are useful for many things.
But sticking with python 2 wouldn't change anything to that matter.
If, as the author of an impressive collection of Python libraries, you had to make a rough estimate of when your Python 3 userbase will reach critical mass, such that they have a reasonable shot at finding those bugs and getting them fixed, how far into the future do you think we're looking?
What do other devs that ported their stuff to P3 say?
I don't even know how to respond to such "logic".
Which version do I learn first?
On a first, ignorant, glance learning Python 3 makes sense because it's the way of the future. Although, the more you learn, you slowly figure out that they're not that different; but, they're communities and supporting libraries are in two separate camps. It's like there's a cold war mentality of people who can't or won't port/migrate to 3 and the Python 3 crowd that looks upon the former with disgust and disdain. There's clearly a huge divide and it's uncomfortable and confusing for new folks to learn and get involved.
Now we're about 6 years since the first Python 3 release and I've never gotten involved with Python beyond a few days of tinkering. I've moved on, and based on my experience, people who are newcomers to programming are walking right by without a second thought. This coupled with the developers that are jumping ship, isn't good news for Python. They need a course change, and they need to make it quickly.
Just my $0.02.
Python 3 is the way to go in the long run.
Python is not a single ecosystem any more. We need separate distributions that can be self contained.
Note:I work for Continuum Analytics.
Yes, we are a company and do sell things, but our commitment to open source is backed by many, many years of significant contributions to the community. We give as much away as we can, and sell to those who need more.
While you certainly buy more from us, Anaconda itself will always be free as long as we can continue to make it.
The non-store link definitely feels more open-sourcey. I'll be sure to send people that way. Again, I didn't want to imply that you all were bad open source stewards.
You can't deprecate a computer language. Such a thing exists independently of implementations.
The problem is that there is a misconception that python libraries needs to be "maintained" and if they are not maintained they should not be used. However, many long-tail libraries really do not need to be "maintained": the code is well tested, works, and it has no security implications. Some of these libraries are just clever algorithms or re-engineering of some obscure protocol or format.
I guess this is one more reason that java is still the safest choice :( Sad.
That said, as a mostly Python 3 developer, PEP 404, to which he links, provides much insight and justification for ending at 2.7. In brief, the changes all seem to me to be efforts to make Python more 'Pythonic' (i.e. TOOWTDI).
PEP 404 2 -> 3 reasoning: http://legacy.python.org/dev/peps/pep-0404/#and-now-for-some...
TOOWTDI: https://wiki.python.org/moin/TOOWTDI
Is the lesson never to bother fixing a major flaw in your software/language after it has been widely used/available?
Perl grew from merely useful to your-favorite-whiz-bang by being a decent language and growing a large collection of third-party modules. Then Larry Wall decided Perl5 wasn't fun anymore (also because of wart accumulation) and declared Perl6 to be The Future(tm). Years later, we have some remaining stuff that's running in Perl5, and also some enthusiasts that use Rakudo and Parrot in an attempt to reach the Shangri-La of Perl 6. But, in many important respects, Perl is an ex-parrot and Parrot won't change that all that much.
Now for Java. Java started out as a slow and ugly cousin of C++ that ran alot slower and gave you the worst of having a bad compiler and a stupid bytecode interpreter. As Java gained traction, Sun and others (e.g. IBM, Apache) proceeded to fix all the warts in a backward-compatible way. Java 1.2 finally had decent collections. Java 1.5 adopted Philip Wadler's proposal for generics through type erasure. Newer Java releases added some sorely-missing utility functions that you'd take for granted in other languages, such as converting between an array and an ArrayList, or splitting a string.
Somewhere in-between, we got servlets, JSP, JDBC, Hibernate, JAXB, a fast compiler. It's not so bad, even though the language still bugs me sometimes.
What's in store for Python? Similarly to Perl, and differently to Java, Python2 has byte-strings, and just when people where coming to grips that there are some things for which str is a good fit and others where you want to use unicode, you got the "unicode as default" in Python3. A conservative approach would be to extend the language and libraries so that it becomes natural to use unicode objects in the places where you're dealing with text, and keep the functionality that bytestrings have around so that the old code is still working. Python3 did not choose the conservative approach - indeed the goal was to do all the compatibility-breaking things that were needed, upfront.
Despite that fact, there is hope that Python will not undergo the Parrot-to-ex-Parrot transition that Perl underwent. The Python core is already there, and many important libraries - including the numpy/Cython etc. toolsuite, and different web frameworks, are actively trying to find the remaining issues.
So, as a summary: A lot of the changes in Python 3, such as renaming the old strings into bytestrings and removing a lot of their functionality, are well-intentioned but have considerable problems. It definitely gets harder to fix major flaws in a language that is widely used, and blackmailing the users by declaring the "not as fun" old version of your language dead should not be done lightly if you don't want to become the next Perl.
It's worse than that. Rakudo developers declared Parrot deprecated (in favor of a new VM which had yet to be written). That, of course, drove off all of the Parrot developers--see the decline in commits in March 2011:
https://www.ohloh.net/p/parrot/commits/summary
If Rakudo ever reaches a point of stable equilibrium where it's reasonable to think about creating libraries for it, P6 still faces an adoption cycle that's more difficult than that of Python 3. There's no plan for P6 to replace Perl (partly to avoid that adoption pain, for one, and partly because P6 has taken so long, there wouldn't be any Perl users remaining unless P6 had publicly changed its strategy).
Python's transition hasn't been quick or easy, but it's gone much, much better than the P6 fiasco.
P6 still faces an adoption cycle that's more difficult than that of Python 3.
I don't see how, especially when p5 developers are saying they will continue to support p5 long after p6 is released. And p6 is such a far drift from p5 that you can almost call it a new language. And no one if their right frame of mind will re write all p5 software in p6.
So it will be p6 for any new projects and p5 supported all along.
There's no plan for P6 to replace Perl (partly to avoid that adoption pain, for one, and partly because P6 has taken so long, there wouldn't be any Perl users remaining unless P6 had publicly changed its strategy).
From what I read(Again, I have no personal contributions or sources and I rely on what I read or hear on the internet) in http://jnthn.net/papers/2014-fosdem-perl6-today.pdf [pdf] rakudo is very close to spec completeness. And bulk of the effort currently is implementing last bits of spec and improving the speed.
Python's transition hasn't been quick or easy, but it's gone much, much better than the P6 fiasco.
Python is hardly comparable with Perl 6. They just changed a print statement and iterators in Python 3. Perl 6 is a very different story completely altogether.
Aiui it was a group of leading P5 devs that made the decision in 2000 to create a backwards incompatible P6, not (just) Larry.
Similarly for Python, Python 3, and GvR.
> Larry decided ... Perl5 wasn't fun anymore
Neither Larry nor GvR has said that about their earlier creations.
Larry did say "We intend to abandon the Perl 5 porter's model of development, which demonstrably leads to a lot of talk but little action." but that's the closest he got to saying Perl 5 wasn't fun anymore. (And P5 regained steam without abandoning the porter's model.)
When announcing P6 Larry said, of P5:
"We all like Perl 5 a lot. We all use it a lot. Many commercial interests will guarantee that Perl 5 continues to be well-maintained ... five years from now a lot of people will still be using Perl 5".
Unfortunately folk jumped to conclusions so this apparently measured statement was still in effect an Osborne One announcement.
> some remaining stuff that's running in Perl5
That's like saying there's some remaining stuff that's running in Python 2.x. True, but grossly misleading.
> some enthusiasts that use Rakudo ... in an attempt to reach the Shangri-La of Perl 6.
The attempt is to produce a compelling option for many future programmers. P6ers may eventually arrive and get stuck at Shangri-La but they clearly hope or think they won't.
> and Parrot
Perl is not tied to Parrot.
Rakudo (or rather the underlying NQP toolchain) is no longer constrained by Parrot because it has its own new dedicated VM. See http://moarvm.org
> blackmailing the users by declaring the "not as fun" old version of your language dead should not be done lightly if you don't want to become the next Perl.
I don't agree that GvR is blackmailing Python users.
But the issue isn't how things actually are. The issue is how things are perceived. If it seems that GvR is blackmailing users, and especially if a bunch of folk are saying as much, there's a problem.
Later several of them where dropped, like the string literal trouble ... But than the trouble was already done. Many extension modules where not lifted to the new version, since the overhead was to big.
I think, many more projects would have adopted Py3, if more extension modules would support it.
The huge library of extension modules was always the strength of Python. Now we have many projects still running on Py2, because Py3 did ignore this strength.
To note, that's not a Python-specific issue: it's the nature of any language ecosystem where modules can be made by anyone, and I'm not even sure it's a bad thing: I've learned a lot, even from libraries that I didn't end up using for whatever reason.
I think it's dangerous to imagine Python or any language as something where all the libraries you need always exist, and thus any time you have to write your own libraries it's a failure. Embrace the library ecosystem: you're going to eventually find something that isn't covered, which is when you write a library and participate.
Disclaimer: I know open sourcing code isn't always possible, and that time/project constraints can impact how much backend code a developer can write. But if we dismiss Python 3 just because some of the more obscure libraries aren't ported, I wonder how we ever picked up Python 2 originally.
Python3 ranks high on the list of engineering failures. Python3 itself is fine, Python3 the deployment and migration is a disaster.
Most of the libraries I'd actually trust for more than a one off script are already ported or have plans for porting.
I wouldn't trust a lot of the unported libraries in a serious Python 2 project, anyway.
Sure they'll move on to python3, in the same way they moved on to C++, Scala, and VHDL.
Perhaps they will never abandon Python 2, like they haven't abandoned Cobol and Fortran. However, that doesn't mean they won't move on to Python 3.
Python 3 occasionally prevents work getting done in Python 2. That's it.
python3 do break many of 3rd-party scripts I am using, so I make /bin/python symlinks to python2. Each python3 update will break these scripts and I needed to symlink python again. So, finally, I removed python3 completely.
These 3d-party python codes are well maintained, but the authors seems not to bother to port them to python3 if python2 is still available.
I'm still intrigued by this situation: I'm running my software on java 8, but I can't compile it as java 8 unless I do that by hand (... really?)
Part of me feels like I'm living in the future, waiting around for everyone else to get over it. I then have to remind myself about the nature of change over large groups of people, and wonder what else I could be missing.
As hard as it is for people like me who use 2.X a lot,Python secured its survival with 3.I wish the transition would have been smoother though.
What the author of this article is suggesting is precisely what Python 2.7 is. Python 2.6 was the last 2.x release that brought new features to the language. 2.7 is only about back porting 3.x language features as a "temporary" stop gap measure until 3.x reaches maturity, both as a language and through 3rd party library support.
It is precisely this kind of thinking that is going to "kill Python," not the language itself.
I kept running into random incompatibility issues even within 2, like Pai Mei (a reverse engineering tool) only working on 2.4.
Python 3 support is getting better everyday.
So what if an obscure library on PyPI doesn't? Port it already. Or don't use it? The other day I removed a 'module' from my project by substituting 1-2 lines for "import lxml" and etree.fromstring(xml) instead...
If the trend continues then in a few years your python skills are going to be legacy only and you will program Go or something.
http://www.wikiart.org/en/gustave-dore/the-inferno-canto-13-...
Short version: Python 2.x is legacy, Python 3.x is the present and future of the language
That's very close to what deprecated means.
I'd much rather bet on the python developers who are shipping software. All major python libraries have been ported to python 3, many of them for years. There's 4799 packages registered on pypi as supporting python 3.
Python is becoming less popular? The author provided no evidence at all. Downloads of python3 from python.org are higher than python 2, and have been for a while now. Job websites show python having more postings than 2 years ago.
Not much has changed in python 3? What rubbish. You just have to look at the thousands of commits, and change lists. Python 3.4 has generic functions to do single dispatch matching on type. You can statically type check python now (see pysonar2, pylint, and pycharm for example). Not only as pypy made a major breakthrough with performant STM based concurrency(no threads), but threading has been improved in python 3 too. There is the new asyncio library for really elegant async, which go along with great generator improvements(yield from). We have CFFI for simpler FFI. Lambdas are kept simple for readability, as functions are preferred.
I'm just going to stop here... many of his statements are just insane. Like this one: "You might as well ask someone to port their entire codebase to Ruby". Um, yeah... porting a codebase to python 3 from python 2 would take more time than porting it to an entire other language. What complete nonsense!
Edit: the post isn't from Microsoft, so fixing it so it isn't misleading. There was a link to a Microsoft person on the top right of the page, which seemed to indicate he was the author. Instead it was just someone promoting the page. Oops/sorry!
The "lazy people" you refer to is 98% of the Python community.
Python 3 didn't "gain" static type checking. You can (and I do) run pylint against Python 2 code which is just static analysis, not full type checking. The situation here has not changed between Python 2 and 3.
Python is glue code. You write a small piece of Python to tie together external libraries. Moving a smallish piece of Python code from Python 2 to Python 3 often means porting several 3rd party libraries. If you were to move to Ruby, all you'd need to rewrite is your own code, as there are likely already 3rd party libraries which need no porting.
Um, no. Major applications are written in Python. It looks to me like the problem is not Python but your perception of it.
I wonder what would have happened if the software that was called 3.0 had been released as "Python 3 Preview Release" or something. I guess the thinking was that would have held people back even more from trying it/porting stuff, but maybe scaling back (end user) expectations for those first couple of versions would have been the better path.
Well, for one thing, Python 2.7 is a newer release than Python 3.0 (2.7 was released after 3.1.)
However, while there may have been good reasons to choose 2.7 over 3.0 (or even 3.1), there aren't nearly as many reasons to choose 2.7 over 3.4.
I think the main role of authors of books on programming is to help their readers to become more effective in solving their programming tasks. So they do, if they're wise and honest.
Maybe you need to read more up to date books. The latest release is Python 3.4, and even most Linux distros are at least at Python 3.2.
English is a much better universal language than esperanto ever will be for this very reason.
You are right that the same tools work for python 2. However, I mentioned tools there which allow python to do type checking, and type inference because they can be done now. See here on how to use them: http://renesd.blogspot.de/2014/05/statically-checking-python...
You're right in that case where you use several libraries that aren't ported. However, there's 4799 packages registered on pypi as supporting python 3, and most of the popular ones are ported. Considering that most libraries are ported, porting small scripts should be easy most of the time. I don't know if you actually ported any code, but it's often trivial.
Glue code is only one of the things that Python can be and is used for. Python is used for small, medium and large [2] applications as well.
Do all of the following look like glue code?
Recent marketing brochure from the PSF (Python Software Foundation) - (it's a PDF):
http://brochure.getpython.info/media/releases/psf-python-bro...
Python success stories:
https://www.python.org/about/success/
Google's web front-end (many of their URLs even end in .py)), Dropbox clients (wxPython), YouTube [3], Disqus are some apps / sites written in Python.
[1] See the paragraphs about YouTube near the end of this post (by me, but much before this current thread):
http://jugad2.blogspot.in/2013/03/youtube-dl-yourube-downloa...
[2], [3] The PyCon talk below is by one of the original engineers at YouTube.
https://us.pycon.org/2012/schedule/presentation/128/
The Wikipedia article below says YouTube is one of the largest web sites in the world. A lot of YouTube is written in Python.
As I noted elsewhere in this thread, the list gets shorter every day:
I actually made the decision to run on Python 2 due to unavailability of these libraries for Python 3 about a year ago (I didn't really care about Python before as I primarily used C++/Java/Asm/GLSL/C#/Haskell in the past) - I was deeply shocked by what Py3 did to its own community and still have that weird feeling that Python is slowly killing itself. I didn't want to write my own Amazon and MS Office wrappers in Python 3 anyway and from all platforms available Py2 seemed to have the least amount of troubles (though I had to write some Py3 code for handling advanced TLS properly).
I mean, yeah, the list is getting smaller. That's understood. But that doesn't render the problem of depending on only-Python 2 libraries moot.
I think the fundamental insight of the OP is that Python X (the purgatory corresponding to code compatible with both Python 2 and 3) is an absolute pain to write. There's plenty you can do to make Python X easier (like the `six` library or ignoring Python 3.{0,1,2}), but the programmer is still left with the burden of writing code compatible with both versions.
There's just no denying that the Python 3 transition is a huge fucking pain that is costing people tons of time and money. With that in mind, it is absolutely reasonable that people are resisting the change.
And it's getting better everyday.
These are really HUGE and I can not do my work without them.
http://highscalability.com/blog/2014/4/28/how-disqus-went-re...
Sorry, I'll have to disagree with your disagreement. Thousands of commits doesn't mean it is worth breaking backwards compatibility. Unicode support? Yeah it is nice. But it worked fine for me before. Print is a function. Again, pretty nice, not nice enough to break backwards compatibility.
> Python 3.4 has generic functions to do single dispatch matching on type.
Ok. Never really needed that in Python. So again not worth breaking backwards compatibility.
> There is the new asyncio library for really elegant async,
That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better. Twisted has been around for ages, and even though it is used here and there it hasn't exactly taken the world by storm yet. So I certainly don't see it as a positive, rather it is a negative. I would rather they adopted greenlet and supported gevent better or integrated PyPy's STM
> We have CFFI for simpler FFI.
Ok, I just used CFFI in Python 2 last week, worked great.
> Lambdas are kept simple for readability, as functions are preferred.
Heavy lambda usage is not that good of a practice in Python. And Python 2 has lambdas as well. It use them sparingly.
> I'm just going to stop here..
Oh no, please don't stop, because you haven't convinced many people Python 3 is better.
> You can statically type check python now (see pysonar2, pylint, and pycharm for example)
You know what has better static type checking? Go. I am sitting down looking at static type checking and fixing code for backward compatibility, I will also be evaluating other languages and platforms.
Python 3 is not bad. But is is not that much better than Python 2. Sorry. A lot of that is not Python 3's fault as much as a testament to how good Python 2 already was.
I think Python 3 should have offered a lot more than unicode and print as a function. A list of possible improvements:
* A JIT compiler
* An STM module
* Better concurrency (removed GIL)
* Maybe integrated requests or flask or some other modern web tools and libraries>> That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better.
Not so much in Python I'm afraid. The new asyncio module is worth the switch by itself I find, while Twisted is pretty good it can be very verbose and suffers from a number of issues.
You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem to think it's only worth progressing the language if its by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me). Python 3 may not have those big blockbuster features but its a nicer language with fewer warts (from __future__ import division? please).
I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised. After using it in a couple of Django projects I have yet to come across any packaging issues, and I use the awesome 'six' library so my code runs on 2 and 3 without modification.
So what if it is. Why not just make prnt a function. Or println or something.
Have urllib and urllib2. Make urllib2 or just put requests in the stdlib.
Still don't see what was worth breaking backward compatibility over.
> You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem
I say it is not worth doing it at the time they did. It just came too late. People how didn't pick python over other frameworks probably weren't put off by the print statement.
This should have happened 5-10 years ago not now. Not it was time for better performance, packaging, web frameworks, better concurrency constructs.
> ts by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me).
Removing the GIL shouldn't break sane code. With GIL you still have race conditions and have to guard against them. You just can't run CPU bound code in parallel. That would be nice to fix.
And if it is beyond you read up on how JPython works because it doesn't have a GIL.
> why you would think of bundling requests or flask with Python is beyond me)
How does bundling a library like that break code?
> I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised.
I switched to using gevent from Twisted and saw speed improvement and code reduction by about 30-50%.
Using argument annotations for type checking is quite useful in IDEs and for statically checking your code.
Asyncio, and yield from have been in the design phase for many years by Guido and the community. This is seriously well thought out concurrency done by people with lots of experience. It's the 4th generation async framework for python.
The better unittest framework saves me time, and helps me with error handling.
pip installed everywhere is a serious productivity improvement.
Function dispatch based on type (ie, pattern matching like some functional languages) is something I've missed for years. It was originally planned for py3k, and I think is the main missing piece from the original design docs.
Importlib is much improved, so you can do some really interesting things with importing code. If you're working on IDEs, or other apps like games this is pretty cool stuff.
Little things like the enum module make APIs that tiny bit cleaner and more intuitive to use.
Speaking of nicer APIs, the Documentation got a lot of fixups too in Python 3.4.
Want to track down memory leaks? Python 3.4 has a whole new set of memory debugging primitives to make this much easier.
There were also a lot of security improvements for 3.4 that have not been backported.
That is a problem.
Just last year, msft gave $100k to the ipython project -
http://ipython.org/microsoft-donation-2013.html
It feels like the original commentor has a beef against msft to read company action into what is an individuals blog entry...
That is a ridiculous statement. So everything like most of the *nix OS and a dozen other super popular products that require python 2.6 or 2.7 are lazy too?
These lazy people probably have a day job where they have to do something productive instead of wanking around with "fun" language features.
PHP 82.0% ASP.NET 17.5% Java 2.7% ColdFusion0.8% Perl 0.6% Ruby 0.5% Python 0.2% JavaScript 0.1%
http://w3techs.com/technologies/overview/programming_languag...
And Coldfusion over Python and Ruby? i dont think so.
Nowadays hardly anybody seems to use Ruby for new projects...
Do you have evidence to back up the claim that Ruby isn't being used for new projects? Even assuming HN is a skewed environment, I see enough Ruby projects popping up here to make that seem unlikely.
http://www.tiobe.com/content/paperinfo/tpci/images/history_R...
1.9 was initially released 2007, 1.9.1 was released in 2009... Not sure if you remember it, but one of the early 1.9 releases was reeeeally buggy.
1.9 was the cleanup release after the language became popular and very necessary.
Also, everything before 1.9.2 was considered a preview release.
That's quite some historical revisionism -- there was quite a while when quite a lot of libraries weren't running on 1.9. It wasn't as bad as with Python, probably because Ruby wasn't popular for as long as Python was, so there weren't as many big libraries that were hard to update. But it was a huge deal.
> 1.9 was the cleanup release after the language became popular and very necessary.
It was necessary for much the same kind of reasons (and, sometimes, the exact same specific reasons) as Python 3 -- particularly, the string encoding problem.
Yeah, but 2.x didn't have major breaking changes. The big breaking change from 1.8.x that parallels the Python 2->3 change was 1.9, which has been out for two years longer than Python 3.
If you don't cannibalize yourself from time to time, someone else will eat you. Fact of life.
Or in simpler words. Stop bitching, and port that library to Python 3.
Alright, boys. Pack it in. We're all going back to C89. Don't try anything new, because you'll never catch up.
Your quoted statement might not imply what I said, but this article damn sure does.
Python 3 introduces far, far more changes than that. It sounds like a world of hurt to port things.
Some people would rather port their entire app to another platform that respects the programmer's historical investment.
Writing code that is compatible with both 2 and 3 is difficult, and this is what the OP was talking about. There are things you can do to make it easier (like using the `six` library or ignoring Python 3.{0,1,2}), but the burden of writing that subset of language that works on both still lies with the programmer.
I've done it and it's not fun. It's also been a source of bugs.
The other snafu here is your dependencies. If you depend on a large project that isn't Python 2/3 compatible, then you're basically shit-out-of-luck.