News for hackers. Stuff that matters.
Re:Porting a historic Python2 module to Python3 by pinpeliponni on Thursday July 27, 2017 @03:19PM (#14868470)
Just tell the Python 2 users frankly to go fuck themselves.
Re:Porting a historic Python2 module to Python3 by sctb on Thursday July 27, 2017 @05:44PM (#14869897)
We detached this subthread from https://news.ycombinator.com/item?id=14868355 and marked it off-topic.
Re:Porting a historic Python2 module to Python3 by melling on Thursday July 27, 2017 @03:33PM (#14868612)
Swift is 3 years old. Most people who use it will be on the latest version Swift 4 within a few months. Apple won’t let developers stay behind.

While it was unrealistic for Python to be that aggressive given its larger community, not forcing the issue created a lot of unnecessary work for the community. A benevolent dictator should have moved developers along faster. Having the language fragmented for this long is extremely unproductive.

Re:Porting a historic Python2 module to Python3 by weberc2 on Thursday July 27, 2017 @03:39PM (#14868680)
I don't think Apple could even get away with this if Swift were more than 3 years old. I suspect the relationship between migration pain and age is exponential.
Re:Porting a historic Python2 module to Python3 by jpttsn on Thursday July 27, 2017 @05:18PM (#14869674)
In part it's age. In part, Apple get away with it because they forewarned developers. Swift explicitly intended a "move fast and break things" approach to syntax, naming etc.
Re:Porting a historic Python2 module to Python3 by BeetleB on Thursday July 27, 2017 @04:18PM (#14869055)
Forcing the issue early on would have killed Python3. For the first so many years, the majority was against Python 3.
Re:Porting a historic Python2 module to Python3 by kbenson on Thursday July 27, 2017 @04:02PM (#14868900)
Isn't Swift compiled? I'm not sure it's relevant to the specific problems faced here, unless a library written and compiled in earlier versions of Swift won't be usable in a Swift 4 project.
Re:Porting a historic Python2 module to Python3 by ori_b on Thursday July 27, 2017 @04:11PM (#14868992)
That's the case. Swift is currently not abi compatible, so libraries compiled with one Swift version only work with that version.
Re:Porting a historic Python2 module to Python3 by kbenson on Thursday July 27, 2017 @05:24PM (#14869733)
Ah, I see. I assume you could compile to a C compatible library, but they you would have to deal with marshaling costs where the types mismatch, correct?
Re:Porting a historic Python2 module to Python3 by jxramos on Thursday July 27, 2017 @03:50PM (#14868787)
I like it, "development tough love", ha. I think looking back it becomes clearer in hindsight that it really did consume a lot of community energy. I'm vaguely sensing maybe some kind of community development bystander effect where fixing and upgrading is someone else's problem has kept the divide around longer than it needed to be.
Re:Porting a historic Python2 module to Python3 by gogopuppygogo on Thursday July 27, 2017 @03:55PM (#14868835)
Python 3 faced a lot of friction when it was introduced.

There was no backwards compatibility with Python 2 and it had relatively little adoption.

They added Python 3 features to Python 2 over the years to encourage adoption of Python 3 as the standard. It worked.

Now we just need Apple to ship Mac OS with Python 3 instead of 2 as the default and that'll push adoption for developers.

Re:Porting a historic Python2 module to Python3 by mikebenfield on Thursday July 27, 2017 @04:25PM (#14869128)
> They added Python 3 features to Python 2 over the years to encourage adoption of Python 3 as the standard. It worked.

Did it really? My impression was the opposite: the fact that so much of Python 3 became available in Python 2 made people feel like there was no point in moving to Python 3.

Re:Porting a historic Python2 module to Python3 by viraptor on Thursday July 27, 2017 @06:17PM (#14870144)
It worked both ways. Some new features were ported back, some could be ported, but explicitly weren't to encourage migration. On the other side, things like the "u" prefix got re-added to python 3 for compatibility.
Re:Porting a historic Python2 module to Python3 by AceJohnny2 on Thursday July 27, 2017 @04:40PM (#14869252)
> Apple won’t let developers stay behind.

On macOS 10.12.5, released 2017-05-15:

    $ /usr/bin/python -V
    Python 2.7.10
That's a release from 2015-05-23. Latest is 2.7.13 released 2016-12-17.

And no system python3. Only through Homebrew/Macports.

Re:Porting a historic Python2 module to Python3 by melling on Thursday July 27, 2017 @04:51PM (#14869368)
I'm not sure I understand your point. They have a version of Perl from 2013 too.

Do you think that means they don't care about Python? Perhaps it's not a strategic language for them?

No one said they the provide a full Unix system or keep everything else up to date. Apple has a very narrow focus on what's important to them.

Re:Porting a historic Python2 module to Python3 by maxerickson on Thursday July 27, 2017 @04:39PM (#14869239)
How would they have forced the issue?
Re:Porting a historic Python2 module to Python3 by concede_pluto on Thursday July 27, 2017 @05:15PM (#14869626)
They should have created an annotation or something saying "this file uses the python3 dialect", made python3 run all python2 code unmodified (the only way to not require both being on $PATH), and halted python2 releases except critical security bugs.
Re:Porting a historic Python2 module to Python3 by godelski on Thursday July 27, 2017 @04:21PM (#14869082)
Aren't there more 2.7 users than 3.x users? I am certain this is true in the scientific community. But I also thought it was true for the general. So telling the majority of your user base "to go fuck themselves" is, generally, not considered a good idea.
Re:Porting a historic Python2 module to Python3 by thephyber on Thursday July 27, 2017 @05:45PM (#14869901)
GP comment seems like a troll. There is no formula as simple as "always use 3 and don't bother with 2". Not all python2 modules have been ported to python3 and python2 modules are unlikely to be future-supported as long as python3.
Re:Porting a historic Python2 module to Python3 by gshulegaard on Thursday July 27, 2017 @03:39PM (#14868678)
Given that many popular distros still have Python 2.7 or older as their default, this seems unwise.
Re:Porting a historic Python2 module to Python3 by concede_pluto on Thursday July 27, 2017 @04:44PM (#14869290)
Because python3 and python2 are incompatible dialects, you have to say which one you want, and there's no reliable way to use just "python" and no useful reason to have it on $PATH. Any code needs to declare all its dependencies, including either python3 or python2. If I didn't want any specific dependencies, I'd be targeting POSIX and writing in Bourne shell.
Re:Porting a historic Python2 module to Python3 by pweissbrod on Thursday July 27, 2017 @05:03PM (#14869496)
If you mean OS distros then this is not a concern. Unless your python needs are very small then you shouldnt use the OS distro for your python apps you should be running them in independent virtual environment with independent versions and packages
Re:Porting a historic Python2 module to Python3 by njharman on Thursday July 27, 2017 @06:32PM (#14870278)
It EOL next year, right? That is the when py2 gets to fuck right off. Until then people have the slimmest of excuses.
Re:Porting a historic Python2 module to Python3 by Scarblac on Friday July 28, 2017 @08:15AM (#14873649)
Python 2 is EOL in 2020 (https://www.python.org/dev/peps/pep-0373/#id2).

Django's next version will be the first that doesn't support Python 2 anymore (because that Django version will be supported longer than Python 2), I hope that that will start the mass updating at my employer's.

Re:Porting a historic Python2 module to Python3 by carapace on Thursday July 27, 2017 @03:45PM (#14868741)
Or, y'know, don't.