6 ms·
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. Pyth
by postfuturist 12y 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.
- higherpurpose 12y agoIn 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?
- pdonis 12y 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.
- rdtsc 12y ago> and even most Linux distros are at least at Python 3.2 Why are you spreading lies? You are hurting your cause (advocating Python 3). Let's take a look at latest Ubuntu: $ cat /etc/issue Ubuntu 14.04 LTS \n \l $ python --version Python 2.7.6 How about the popular server distro CentOS 6? $ cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m $ python --version Python 2.6.6 What exactly are these "most" Linux distros everyone is using that I haven't heard of?
- chc 12y agoMany distros include both Python 2 and Python 3 support. I think pdonis is saying that distros that support Python 3 are not stuck on 3.0. That is, their Python 3 packages are 3.2 or higher, so comparing 2.7 to 3.0 is unreasonable, since it's not a choice anyone has to make. Which seems to be true. For example, the relatively conservative Debian is currently on Python 3.2, with Python 3.3 in the next version. Ubuntu's python3 is currently 3.4. Fedora appears to be 3.2. Arch has Python 3.4, I think. So what pdonis was saying is, as far as I can tell, true.
- deleted 12y ago[deleted]
- chc 12y agoSorry about that. I wrote that comment in too much of a hurry. Corrected now.
- rdtsc 12y agoThey do. But python3 is not the default python. Download a python script run it and it will run on Python 2.7.6. Yes that OP meant to say that because he clarified it later. But I don't see how his original comment of: > most Linux distros are at least at Python 3.2 implies that. To me that says 3.2+ ships as the default version of Python.
- pdonis 12y ago> python3 is not the default python. The post I was responding to talked about books on Python for students, presumably students studying programming. Python 3 doesn't need to be the default python for students studying programming to use it; it just needs to be available. If the post had been talking about, say, sysadmins, that would be a different story.
- rat87 12y agoI think it's recommended for distros to modify the shebang to /usr/bin/env python3 for script that are supposed to run under python 3, although this does pose a problem for scripts that want to run under both without modification. If the distro ships with python3 and most of the system scripts run under python3 I'd say its the default.Ubuntu for one is planning on not shipping a python2 or /usr/bin/python binary by default(although it will still be in repos) eventually.
- claystu 12y agoAccording to Distrowatch, out of the top twelve (12) distros, all but #8--Arch--use Python2. The other 11 in order of popularity are #1 Mint, #2 Ubuntu, #3 Debian, #4 Mageia, #5 Fedora, #6 openSUSE, #7 elementary OS, #9 Zorin OS, #10 Puppy Linux, #11 PCLinuxOS, and #12 CentOS. Most Linux distros use Python 2.
- chc 12y agoThat's not quite a complete picture. Those distros include Python 2 as the default "python" executable, but many include Python 3 as python3, and even more have standard python3 packages that just aren't installed by default.
- unethical_ban 12y agoAt work, I am writing tools in Python 2.6.6 specifically because the latest version of RHEL comes with only that, and I cannot get aftermarket versions of tools onto our servers. Is that the fault of Python? No, but I'm sure I'm not the only person working at a stuffy organization with crappy open source policy.
- rdtsc 12y agoSo do I (in some cases even stuck on Python 2.4) [RHEL 5]. But at the same time (re: Python 2.6) I never really thought "oh I really need the latest 3.4 or my project will fail". It doesn't offer dramatic speed improvement, concurrency, some nice built-in web framework or anything. I would take 3.4 if someone else spent the time testing and validating my code against but I just don't have the time to invest because I just don't see an upside to it at the moment.
- fleitz 12y agoWhy? 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.
- maxerickson 12y agoPrior 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.
- piokuc 12y 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.
- dragonwriter 12y 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.
- akerl_ 12y agoDo 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/ http://python3wos.appspot.com/
- postfuturist 12y agoDid 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.
- illumen 12y agogevent is ported to python 3. I guess a proper release would be soon. See here: https://github.com/surfly/gevent/issues/38 https://github.com/surfly/gevent/issues/38 If the libraries are used by people, they tend to get ported. Like most of the most popular packages, and 4799 packages listed on pypi. Any others you depend on? I'm prepared to roll up my sleeves and help.
- YokoZar 12y agoIf you genuinely want to help, I suggest porting launchpadlib to Python3: https://bugs.launchpad.net/launchpadlib/+bug/1060734 https://bugs.launchpad.net/launchpadlib/+bug/1060734 This is affecting other parts of Ubuntu, as we don't always install python2 anymore after porting all the default apps to python3. The lack of python3 launchpadlib means apport (the automatic bug reporting tool) doesn't work on some installations. edit: porting launchpadlib requires first porting lazr.restfulclient, which might be genuinely challenging: https://bugs.launchpad.net/lazr.restfulclient/+bug/1000801 https://bugs.launchpad.net/lazr.restfulclient/+bug/1000801
- toma7 12y agoLet's assume a modestly sized Python program uses 8 libraries or so. Assuming 80% of libraries are ported, that means 20% aren't. The likelihood of at least one of your 8 libraries not being ported is 1 - (0.8)^8 = 83%. In other words, most people will find that at least one of their cricitcal libraries is not ported. That is certainly the case for me (Bloomberg Python API, for 2.7, and which, btw, only came out 6 months ago). Inevitably the people using Python come from specific domains, and use at least one domain specific library, so while all the common "usual suspect" libraries are ported, there is usually a very high chance that one critical library is not. Perhaps the way the entire question should be thought of is: are there actually many properly useful Python 3 libraries that are not available in Python 2?? I bet the above equation would look much better when inverted.
- illumen 12y agoThere 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.html 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.
- pdonis 12y 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 12y agoFrom 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.
- pdonis 12y ago> From personal observation Which is not a good metric. Have there been any actual surveys or studies of Python programmers to see what the distribution is? > having written a major application in python, I'm not really convinced it's a good language for it. Out of curiosity, what was the major application?
- coldtea 12y ago>Which is not a good metric. Have there been any actual surveys or studies of Python programmers to see what the distribution is? So where are your metrics?
- pdonis 12y agohttp://en.wikipedia.org/wiki/List_of_Python_software http://en.wikipedia.org/wiki/List_of_Python_software This doesn't show how many programmers work on "glue code" vs. "major applications" (which is why I asked if anyone has data on that), but it certainly shows that there is a lot of Python code out there that is not just "glue code". Bear in mind that it's not just the particular packages listed on that page, since many of them are frameworks; there are also plenty of "major applications" written in those frameworks. (I am counting major websites using a web framework, major numerical applications using NumPy or SciPy, etc., as "major applications", btw, not "glue code". I suspect on re-reading this subthread that the poster I was originally responding to might differ with me on that point, but application logic is not "glue code" in my view.)
- vram22 12y 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-brochure-vol.-i-final-download.pdf http://brochure.getpython.info/media/releases/psf-python-bro... Python success stories: https://www.python.org/about/success/ 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-downloader-in-python.html 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/ 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 http://en.wikipedia.org/wiki/YouTube
- vram22 12y agoAlso: Disqus, written partly in Python, mentioned on the High Scalability site: http://highscalability.com/blog/2014/4/28/how-disqus-went-realtime-with-165k-messages-per-second-and-l.html http://highscalability.com/blog/2014/4/28/how-disqus-went-re...