top | item 7800050

(no title)

postfuturist | 11 years ago

I'm the author. I've never worked at Microsoft (where did you get that?). I'm a Linux guy.

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.

discuss

order

pdonis|11 years ago

> Python is glue code.

Um, no. Major applications are written in Python. It looks to me like the problem is not Python but your perception of it.

dagw|11 years ago

From personal observation I'd say that for every person writing major applications in python you have at least 20 using it for glue code. And having written a major application in python, I'm not really convinced it's a good language for it.

higherpurpose|11 years ago

In every Python book I read they were recommending me to use Python 2.7 instead of 3.0. Shouldn't it be the role of educators to promote the latest version out there and work with it, so that by the time the new students get into a working environment they are already on the same page with what is required?

maxerickson|11 years ago

Prior to the release of 3.2 (Feb. 2011, 2.5 years after the initial 3.0), that was clearly reasonable advice. The io subsystem in 3.0 was quite slow, making it uncompetitive with 2.6, and while 3.1 fixed that, there were still too many missing libraries (and similar issues).

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.

dragonwriter|11 years ago

> In every Python book I read they were recommending me to use Python 2.7 instead of 3.0.

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.

piokuc|11 years ago

> Shouldn't it be the role of educators to promote the latest version out there

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.

pdonis|11 years ago

> Python 2.7 instead of 3.0.

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.

fleitz|11 years ago

Why? Languages are tools used for communications, if there is no one to talk to there is little point in learning a language.

English is a much better universal language than esperanto ever will be for this very reason.

illumen|11 years ago

There was a link to a Microsoft person in the top right of your page. I mistook it for the author link. Edited post to remove that.

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.

zerd|11 years ago

4799 out of 44198 are python3? just a few more to go.

vram22|11 years ago

>Python is glue code. You write a small piece of Python to tie together external libraries.

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.

http://en.wikipedia.org/wiki/YouTube

akerl_|11 years ago

Do you have examples for these critical 3rd party libraries that haven't yet been ported?

As I noted elsewhere in this thread, the list gets shorter every day:

http://python3wos.appspot.com/

bitL|11 years ago

If you are running multiple automated eCommerce companies that have their core system written in Python 2 like I do, you'd find that boto/mws and python-excel aren't available for Python 3 (python-excel's porting to Py3 stopped in 2011), which would prevent you from spawning new businesses on Amazon or handling (unfortunately standard) MS Office interchange files quickly.

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).

burntsushi|11 years ago

I just looked at that list and I see several prominent projects that (according to that list) don't support Python 3: MySQL-python, gevent, Twisted, eventlet, oauth2, thrift, nltk, mechanize, etc. I've used more than a few of these libraries over the years.

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.

rcruzeiro|11 years ago

Off the top of my head: Twisted and gevent. It was actually the lack of a Python 3 gevent that lead my to create one crucial piece of software for my startup using NodeJs communicating with the main Python application passing messages via Redis.

Ihmahr|11 years ago

Numpy, Scipy, NLTK.

These are really HUGE and I can not do my work without them.

phkahler|11 years ago

wxPython is a big one for me. But it looks more like it's dying altogether rather than not getting ported to 3.

postfuturist|11 years ago

Did you read the article? The long tail is the critical collection of libraries and most of them will never be ported. People write new Python 2 libraries every day, actually--the list is getting longer, not shorter. That said, gevent is an extremely critical library for a lot of production Python 2 code. There doesn't even seem to be a roadmap to port it to Python 3.

DRAGONERO|11 years ago

I'd love to have scapy for Python 3. A lot of ports of it have been started but it seems none of them reached a working state.

dagw|11 years ago

There's a large number of significant commercial applications that use Python as their scripting and plug-in language. Non of them that I am aware of are showing any interest in Python 3.