News for hackers. Stuff that matters.
Re:Grumpy: Go running Python by BuckRogers on Wednesday January 04, 2017 @01:30PM (#13320774)
Python3 was never the future of Python. It never got over the hump all new languages need to if attempting to reach relevance.

It's likely code using lots of C-extensions will continue with CPython2 and new code will be written in Grumpy (pure Python2).

Re:Grumpy: Go running Python by cdelsolar on Wednesday January 04, 2017 @01:38PM (#13320858)
That is pretty ridiculous. Pretty much all major libraries are Python 3 compatible and everyone is writing Python 3 (or should be). (Yes, I'm still on Python 2 but moving soon).
Re:Grumpy: Go running Python by spanishgum on Wednesday January 04, 2017 @01:54PM (#13321009)
My python course at uni focused on python3. We talked about differences and toyed with both interpreters, but ultimately wrote all projects and assignments in 3. I'm sure this is the case for students at other schools too.
Re:Grumpy: Go running Python by quotemstr on Wednesday January 04, 2017 @01:46PM (#13320928)
I've been writing Python 3 for years.
Re:Grumpy: Go running Python by BuckRogers on Wednesday January 04, 2017 @01:50PM (#13320974)
That's top-down change from the PSF/core dev team and some major library developers added dual 2/3 support. The users never arrived and it'll be 10 years Python3 has been available next December. I'd like to unify Python again but we as users didn't break it either. 10 years any reasonable person in charge would hang it up or change course.

Grumpy is pretty much what most everyone would actually want out of a new Python and may have arrived just in time.

Re:Grumpy: Go running Python by lima on Wednesday January 04, 2017 @03:11PM (#13321634)
> some major library developers added dual 2/3 support

> The users never arrived

That's the way it used to be a few years ago - it changed a lot the last few years. Pretty much all libraries are ported and many new libraries are Python 3-only.

asyncio is nice.

All Python devs I personally know moved to Python 3. Porting is a lot less painful than it used to be.

Re:Grumpy: Go running Python by BuckRogers on Wednesday January 04, 2017 @06:46PM (#13323268)
Gevent is nice. AsyncIO is terrible[0].

[0]http://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio...

Re:Grumpy: Go running Python by orf on Wednesday January 04, 2017 @07:16PM (#13323481)
It's actually ridiculously nice, especially with the new async/await constructs.
Re:Grumpy: Go running Python by dismantlethesun on Thursday January 05, 2017 @05:13AM (#13326030)
Python 3 is largely cross-compatible with Python 2. If you're not working with unicode, not reliant on perfect floating point division, and not using aysncio, then chances are what you produce will work just fine on Python 2.
Re:Grumpy: Go running Python by kj01a on Wednesday January 04, 2017 @03:12PM (#13321645)
>(Yes, I'm still on Python 2 but moving soon).

I'm like really new to programming and I'm still just learning the basics, but I see this little addendum a lot from people who say everyone should be writing Python 3.

Re:Grumpy: Go running Python by wiz21c on Wednesday January 04, 2017 @04:24PM (#13322180)
me too. I've migrated a big project from 2 to 3 two years ago. And let's get this straight : innovation happens on python 3. So staying on 2 would feel like riding a dead horse. I know I did the right thing.

And if Google can make an interpreter for 2, then sooner or later, one for 3 will pop up. Since Google made some restrictions on what Grumpy supports from python 2, I'm sure someone somewhere will be able to do the same stuff for three.

Re:Grumpy: Go running Python by cdelsolar on Wednesday January 04, 2017 @05:46PM (#13322843)
It's true, but moving our huge codebase to Python 3 is a big undertaking. We're making progress towards it by using Python 3 constructs for new files, etc. For my personal projects I'm already in the process of moving over.
Re:Grumpy: Go running Python by kj01a on Wednesday January 04, 2017 @10:37PM (#13324502)
So is it just a time issue, or are there compatibility reasons for why not all of you code is Python 3?

I ask because I started to learn to code with Python 2 because that's what was preloaded on my system. Is one over the other a big enough deal at a beginner level that I should switch to 3 now? How much of a learning curve am I in for?

Re:Grumpy: Go running Python by mastazi on Wednesday January 04, 2017 @11:02PM (#13324625)
> Is one over the other a big enough deal at a beginner level

No, at a beginner level it's not, there are many guides that explain the differences at a beginner level, and you can go through those in a few hours at most, for example http://python-future.org/compatible_idioms.html

But, if you start working now on a Python 2 project and that project starts growing significantly, then it will be hard to convert the codebase. That's why you can see people saying that they didn't switch yet, it's not that they don't know Python 3, it's that upgrading large legacy code bases is hard (not only in Python).

Re:Grumpy: Go running Python by wiz21c on Thursday January 05, 2017 @04:05AM (#13325791)
For me, the hardest part was migrating from Python 2 string to Python 3 Unicode string. But at the same time, this was a huge improvement for my code base because I work with several languages and unicode makes that much easier/safer. So it was a good thing.

Now the rest of upgrades were a bit painful (I was using some functional programming stuff, httprequest libraries, etc.)

Re:Grumpy: Go running Python by kj01a on Wednesday January 04, 2017 @11:20PM (#13324709)
Okay. Thank you for the advice.

My biggest program is like 100 lines of code maybe. So I will go ahead an switch now. But it's like 10pm where I'm at so here's hoping I don't play too much...

Re:Grumpy: Go running Python by cdelsolar on Tuesday January 10, 2017 @01:56PM (#13367755)
Just a time issue. I don't believe the learning curve is that big, most of it would be in how you deal with strings and the `print` statement, which isn't that heavily used in web apps.
Re:Grumpy: Go running Python by johnny22 on Wednesday January 04, 2017 @11:29PM (#13324745)
what system is that? a mac? If so , the sadly you do have to get py3 yourself. If a Linux distro, then you likely already have python 3 preinstalled. `/usr/bin/python` won't point to python3 in anytime in the near future.
Re:Grumpy: Go running Python by kj01a on Thursday January 05, 2017 @09:13AM (#13327189)
Haha it's Ubuntu. After I downloaded Python 3.6 last night, I found out I had Python 3.4 already on my machine. I got excited about new software and forgot to check. It's a crutch :/
Re:Grumpy: Go running Python by kstrauser on Wednesday January 04, 2017 @03:53PM (#13321928)
Here, I'll give you a counterexample:

We're on Python 3 for all new stuff, and are migrating the old whenever we can.

Re:Grumpy: Go running Python by joatmon-snoo on Wednesday January 04, 2017 @04:25PM (#13322190)
Python 2.7 is EOL in 2020. Make of that what you will :/
Re:Grumpy: Go running Python by loeg on Wednesday January 04, 2017 @04:37PM (#13322286)
The community will fork the 2.7 codebase and continue to support it, even if Python.org EOLs it.
Re:Grumpy: Go running Python by xrange on Wednesday January 04, 2017 @06:05PM (#13322969)
It looks like all Python 2.8 is missing is a new name:

https://www.naftaliharris.com/blog/why-making-python-2.8/

Re:Grumpy: Go running Python by ensignavenger on Wednesday January 04, 2017 @06:20PM (#13323076)
I can see "the community" doing security fixes, maybe some bug fixing and a few back ports, but so far I havn't seen much effort from any community to bring active development of new features.
Re:Grumpy: Go running Python by loeg on Thursday January 05, 2017 @02:41AM (#13325451)
It seems like the 2.7 community is happy enough without the new features -- just need the bugfixes and continued backwards compatibility to keep that segment happy.

From a new features perspective, the other reply's Placeholder is fascinating. (I haven't looked into it thoroughly yet.)

Re:Grumpy: Go running Python by ensignavenger on Thursday January 05, 2017 @10:22AM (#13327756)
It is certainly interesting if it truly materializes. But it looks like the plan is to mostly backport stuff from py3- so py3 is still the future, with Placeholder getting some of those features eventually. And that is great from a legacy codebase perspective.
Re:Grumpy: Go running Python by loeg on Thursday January 05, 2017 @11:48AM (#13328674)
Right.
Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @06:24PM (#13323108)
That means nothing. Python 3 was also expected to be mainstream by 2015, but it's nowhere near even 30% yet.
Re:Grumpy: Go running Python by orf on Wednesday January 04, 2017 @07:15PM (#13323469)
It's mainstream for new projects. Which is what was expected and aimed for.
Re:Grumpy: Go running Python by coldtea on Thursday January 05, 2017 @03:20AM (#13325617)
Citation needed. Most companies I know that have 2.7 older projects also do new projects in 2.7. They don't want to introduce 2 different versions of the language, set of dependencies etc to their production.
Re:Grumpy: Go running Python by jwillp on Friday January 06, 2017 @03:18AM (#13334720)
absolutely true. imagine porting a decade or more of code for only the promised benefit of a more "pure" language. asyncio is nice, but excluding it and enhanced generator syntax from 2.7+ is >policy<, not engineering. python 3 is bootheel style top-down engineering >management<, not good engineering. The BFDL is fallible. Placeholder looks like a great Python 2.8+ to me. Runs all my old code and gives me new syntax, without rejiggering the stdlib for purity's sake? Twist my arm.
Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @01:47PM (#13320945)
>and everyone is writing Python 3 (or should be)

You'd be surprised.

If anything, the numbers show the opposite. The vast majority of Python codebases, legacy or new, are 2.7 or older.

Re:Grumpy: Go running Python by dbaupp on Wednesday January 04, 2017 @02:06PM (#13321093)
Which numbers? People keep saying things like that, but things like the Python 3 Wall of Superpowers https://python3wos.appspot.com/ don't seem to support it. Do you have something more concrete?
Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @02:17PM (#13321182)
The "Wall" is just numbers for Python3, without context for how it compares to Python 2.

For 2.7 Pypy reported 419,227,040 downloads for 2016.

At the same time, for ALL 3.x versions combined (up to 3.6) there are just: ~52 million downloads.

That's 1/8th of the Python 2 downloads.

Re:Grumpy: Go running Python by LeifCarrotson on Wednesday January 04, 2017 @02:47PM (#13321430)
Given that there are only 7.5 billion humans on the planet, and that rather significantly fewer than 1 in 20 people are PyPy-using developers, perhaps those numbers should be taken with a grain of salt?

The message I would take from those statistics is that needing a fresh download of Pypy is less common among 3.x users than among 2.7 users, who apparently needed to reinstall from the web at least a few times a day during 2016.

Re:Grumpy: Go running Python by simula67 on Thursday January 05, 2017 @01:42AM (#13325237)
> The message I would take from those statistics is that needing a fresh download of Pypy is less common among 3.x users than among 2.7 users, who apparently needed to reinstall from the web at least a few times a day during 2016.

Occam's Razor would suggest that there are fewer Python 3 users

Re:Grumpy: Go running Python by gsnedders on Wednesday January 04, 2017 @05:16PM (#13322626)
It should be PyPI rather than PyPy in the parent, FWIW.
Re:Grumpy: Go running Python by coldtea on Friday January 06, 2017 @11:34AM (#13337645)
Oops, mea culpa.
Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @06:05PM (#13322966)
>Given that there are only 7.5 billion humans on the planet, and that rather significantly fewer than 1 in 20 people are PyPy-using developers, perhaps those numbers should be taken with a grain of salt?

Those are not downloads of PyPi, but of packages. It's not like "number of downloads == number of individual developers". Those are packages, including package updates. A single developer can download 50 deps across his codebase, and update them to later versions 2-3 times a year.

Re:Grumpy: Go running Python by orf on Wednesday January 04, 2017 @07:19PM (#13323507)
> A single developer can download 50 deps across his codebase, and update them to later versions 2-3 times a year.

As if individual developers are the reason behind the bulk of the downloads. I wonder how many downloads Travis alone counts for?

Your hate of Python 3 in every discussion about it is frankly baffling.

Re:Grumpy: Go running Python by coldtea on Thursday January 05, 2017 @03:29AM (#13325652)
>As if individual developers are the reason behind the bulk of the downloads. I wonder how many downloads Travis alone counts for?

Travis runs/tests user projects, so there's nothing about it that's especially partial to Python 2 over Python 3.

>Your hate of Python 3 in every discussion about it is frankly baffling.

Or, you know, my pragmatic assessment of its popularity.

That you'd even use the word "hate" (when in fact, I like Python 3 over 2.7, even if its mostly tame updates over what 2.7 offers) shows that you're probably too partisan. I was enthused with Python 3 even when it was only a vision called Python3K back in 2000-ish. My personal preference has nothing to do with whether I see more people using it or not.

The situation is not unlike the perennial "next year is when Linux dominates the desktop", which has been every year since 1999.

Re:Grumpy: Go running Python by orf on Thursday January 05, 2017 @07:52AM (#13326709)
> even if its mostly tame updates over what 2.7 offers

> The situation is not unlike the perennial "next year is when Linux dominates the desktop", which has been every year since 1999.

Your bias is showing, as it does in every comment section on this site regarding Python 3, as you make comment after comment about how inferior Python 3 is and how nobody is using it at all because your sample of 2 companies shows this and how it personally hurt your family or whatever. You don't stop. Either you hate it or you hate something else and use Python 3 as a vent.

Re:Grumpy: Go running Python by coldtea on Thursday January 05, 2017 @09:36AM (#13327360)
If by "your bias" your mean my assesment of the state of Python 3 vs 2, that doesn't change depending on whether I like the language or not, then we agree.

>as you make comment after comment about how inferior Python 3 is

Actually I've never made any such comment. In fact, tame updates" means that IT IS an update over 2.x, only not that much as it could be. Which most people I've read agree, or at least agreed until the async stuff.

>and how nobody is using it at all because your sample of 2 companies shows this and how it personally hurt your family or whatever.

Notice how I never said that, but actually gave concrete numbers that place those using it in much less (up to 1/8 less) of those who use 2.x?

So why the lie? Less is not the same as "nobody at all", and doesn't fix by itself just because you really really wish more people used 3.

>You don't stop.

Yeah, I continue expressing my opinion and my argumentation. I should stop because you happen not to like it?

Please don't bring "the feelz" into technical and community discussions. It cheapens the argumentation. If anything, it's you who are biased: 80% of your submissions on HN are for Python stories.

One can acknowledge that D is way less popular than Golang or that Perl 6 failed to gain traction over 5, without hating Perl 6. Ditto for Python.

Re:Grumpy: Go running Python by BuckRogers on Thursday January 05, 2017 @11:29AM (#13328469)
How can you accuse him of that? You're rebutting everyone with Python3 criticism, including myself. This is a prime example of projection. You're the one on a rampage, against Python2.

From what I've seen of his posts, he's only talking about the reality of the situation.. not "how it should be".

Go look at the stats on PyPi and other metrics. Python3 failed, there is a cutoff time for adoption. It's no different than the first 24 hours of a missing person report. You don't get eternity to see if something is going to pan out or not. We're past that point for Python3. It may survive as it's own (smaller) thing, but Python2 isn't going to die either and that's more assured than Python3's fate.

And coldtea is right, but we're not going to do your research for you. What I'm saying needed to be said to you, but you need to find better ways to contribute than just rebutting everyone who has something to say about Python3. Talking about how he hates "something else" and using Python3 as a vent is just ridiculous.

Re:Grumpy: Go running Python by dbaupp on Wednesday January 04, 2017 @06:29PM (#13323159)
That response is talking about something else because your original comment accidentally said "PyPy", which is an implementation of Python, instead of "PyPI", the package repository.
Re:Grumpy: Go running Python by kstrauser on Wednesday January 04, 2017 @03:56PM (#13321958)
A huge confounding factor: newer Py3 codebases are more likely to be built with newer pipeline tooling like devpi (to cache PyPI downloads), wheel (to cache locally-built packages), and Docker (which caches all the things).

Our legacy Python 2 build pipelines that we're actively moving off of hit PyPI far more often than our Py3 processes.

Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @06:09PM (#13322992)
>A huge confounding factor: newer Py3 codebases are more likely to be built with newer pipeline tooling like devpi (to cache PyPI downloads), wheel (to cache locally-built packages), and Docker (which caches all the things).

Maybe in your case, but from what I've seen, I seriously doubt use of Docker or Devpi makes any dent in newer Py3 codebase dependency downloads. Besides, tons of new codebases for greenfield projects are still done in 2.x Python.

Not sure how it is in scientific computing area, but for enterprise/web apps, any company that has legacy 2.x code and libs in production (which is most of them) will continue to write new parts (including new projects) in 2.7 for compatibility with their Python production setup.

3.x is either from companies that didn't already have significant 2.x Python code in production (generally newer companies that for some reason went with Python instead of Node or Go that the cool kids use) or new programmers that just get started and start with 3.x.

Re:Grumpy: Go running Python by lima on Wednesday January 04, 2017 @03:15PM (#13321658)
The PyPy statistics aren't worth much since they're counting all sorts of automated downloads/dependencies/etc.

That's why packages like supervisor and graphite - which aren't libraries - are among the top downloads.

Re:Grumpy: Go running Python by coldtea on Wednesday January 04, 2017 @06:11PM (#13323012)
>The PyPy statistics aren't worth much since they're counting all sorts of automated downloads/dependencies/etc.

Those would exist for both 2.x and 3.x so it's not a differentiating factor.

Re:Grumpy: Go running Python by Certhas on Wednesday January 04, 2017 @02:18PM (#13321185)
There's plenty of 2.7 out there, but we're moving over slowly, basically due to the nice function annotation/type checking work. That's to me the first really compelling reason to use the latter.
Re:Grumpy: Go running Python by lima on Wednesday January 04, 2017 @03:16PM (#13321677)
Hell, even OpenStack (which is giant tangled mess of code written by like a few dozen teams) is making good progress.