News for hackers. Stuff that matters.
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.