News for hackers. Stuff that matters.
Re:New IPython release drops Python 2.7 support by cookiecaper on Thursday April 20, 2017 @02:09PM (#14159221)
I really don't understand why. Python 3 is not a radical departure and the usual complaint is the dependency graph. Over the last 18 months that has really healed up, to the point where the Wall of Superpowers is almost 100% green.

I understand that some people want to keep old code running as long as humanly possible, which is their prerogative. But there's no reason to imply that conversion to Py3 is unduly difficult or something that shouldn't be undertaken, even for large/complex codebases. If Google can write grumpy to transpile Python code to Go, there's no reason it can't improve 2to3 to handle their incompatibilities.

Re:New IPython release drops Python 2.7 support by scrollaway on Thursday April 20, 2017 @02:25PM (#14159360)
I think the main issue is library compatibility, which gives people the impression that compatibility is an unreachable target.

The truth is, once most libraries are 3.x compatible, porting is very easy (as easy as a 2.x -> 2.y transition). And now, we've reached that point. People are starting to catch up.

There are some exceptions of course, those who heavily rely on 2.x unicode behaviour and such, but all in all they are rare. So now, it's much easier than it used to be.

Re:New IPython release drops Python 2.7 support by eikenberry on Thursday April 20, 2017 @04:44PM (#14160669)
> as easy as a 2.x -> 2.y transition

You mean I can just run all my python2 programs with python3 runtime with no changes at all. Because that was how every upgrade before python3 went.

Re:New IPython release drops Python 2.7 support by pekk on Thursday April 20, 2017 @06:43PM (#14161555)
This is simply not true. For example, Python 2.6 deprecated string exceptions. If you expect in any language to write code and have it run forever, you expect that language never to change.
Re:New IPython release drops Python 2.7 support by cookiecaper on Thursday April 20, 2017 @08:31PM (#14162130)
Yep. It's not Python-exclusive either. I can't upgrade to Ruby 2.4 yet because one of my dependencies hasn't been updated.

Breaking changes are a routine thing in any maintained language; heck, even a conservative project like GCC breaks code between major releases.

Re:New IPython release drops Python 2.7 support by Chris2048 on Thursday April 20, 2017 @08:32PM (#14162137)
Were string exceptions deprecated in 2.6 because they don't exist in py3?
Re:New IPython release drops Python 2.7 support by scrollaway on Thursday April 20, 2017 @09:10PM (#14162300)
String exceptions don't exist in py3 because they were deprecated in 2.6.
Re:New IPython release drops Python 2.7 support by scrollaway on Thursday April 20, 2017 @05:43PM (#14161197)
Nearly all my code co-runs on 2.7 / 3.6 with almost no hacks. So, yes.
Re:New IPython release drops Python 2.7 support by Chris2048 on Thursday April 20, 2017 @08:33PM (#14162138)
And your code is all code?
Re:New IPython release drops Python 2.7 support by scrollaway on Thursday April 20, 2017 @09:09PM (#14162298)
https://github.com/jleclanche

The code that doesn't run on Python 2+3 only runs on Python 3. Have at it.

Re:New IPython release drops Python 2.7 support by Chris2048 on Friday April 21, 2017 @06:06AM (#14164258)
What is your point here?
Re:New IPython release drops Python 2.7 support by scrollaway on Friday April 21, 2017 @08:46AM (#14165029)
What is yours? You're the one asking.
Re:New IPython release drops Python 2.7 support by Chris2048 on Friday April 21, 2017 @12:55PM (#14167229)
Asking what?

eikenberry asked: "can just run all my python2 programs with python3 runtime with no changes at all"

You replied: "Nearly all my code co-runs on 2.7 / 3.6 with almost no hacks. So, yes.", implying that, yes, you can run py2 programs without change, because this is true of your code

To which I replied "And your code is all code?"; Meaning, just because this is true of your code, doesn't mean it is true of eikenberry's code, or any/all code.

You then responded with a project that apparently runs fully on py3, but only partially on py2 - what is the point you are making by posting that project?

Re:New IPython release drops Python 2.7 support by jedberg on Thursday April 20, 2017 @05:35PM (#14161146)
I was going to say "because hosted solutions don't support Python 3" but I see that two days ago Amazon announced Lambda support for Python 3, which was my big holdup.

So I guess it's time for me to get on board with Python3!

Re:New IPython release drops Python 2.7 support by sigjuice on Thursday April 20, 2017 @05:08PM (#14160920)
What is the largest Python 2 codebase you can point at which has gone Python 3?
Re:New IPython release drops Python 2.7 support by collinmanderson on Friday April 21, 2017 @11:07PM (#14170919)
Re:New IPython release drops Python 2.7 support by carreau on Thursday April 20, 2017 @05:20PM (#14161037)
Django.
Re:New IPython release drops Python 2.7 support by rsj_hn on Sunday April 23, 2017 @01:30AM (#14176691)
"I really don't understand why."

Because you are suffering from the exponential growth mindset, in which the next new thing is as important as the sum total of all things that came before it. In that mindset, the future is emphasized and the past is heavily discounted.

http://idlewords.com/talks/web_design_first_100_years.htm

But that mindset is not shared by most firms in most industries, it's a unique pathology to the web.

Businesses don't re-write working code just because a newer language version is available. Landlords don't tear down old apartment buildings just because more efficient building technologies are available. We live in a world in which COBOL runs a lot of mission critical code.

Anything that touches important code that is now working is a risk and an expense, and what is the tangible gain for undertaking this expense? What new features will be added? How much more revenue will you get? What is the opportunity cost of having your engineers do that than something else, like adding a feature or improving test coverage?

Before you say that it's simple, be aware that you are talking about messing with libraries that may not be maintained anymore. You are going to spend a lot of time debugging those old libraries as well as writing unit tests for them. Nothing in the world of software engineering is simple, especially when it comes to maintaining a large body of scripts.

Imagine if in the Java world, it was announced that the Java 8 runtime would not support running Java 6 or older jars. How many jars are businesses running that were written in 2005? No one even know who wrote those libraries.

Suppose in the C world, it was announced that code written in C'99 and before would no longer compile. The Linux kernel has code written in the 90s, and GCC has code written in the 70s and it's still supposed to compile under the most modern compiler.

Moreover automated code re-writing tools don't come with guarantees of soundness or accuracy. There will be breakage, it will occur in random places, and there is zero upside to spending a lot of money to get an existing project to the same level of functionality as it had before you started messing with it.

People who work in other languages get this. It's really not a difficult concept. Everyone other than the Python community agrees that Python did a massive screw up with python 3, just as the Perl community committed suicide by making Perl 6 not be compatible with Perl 5.

I don't pretend to know what will be the future of Python -- maybe there isn't enough enterprise users out there to make a difference for the direction of the language -- but you do need to understand why breaking existing code is a deal breaker for the majority of business customers. You may disagree, but at least don't pretend that there is some irrational mysterious resistance to converting python2 code to python3.

Re:New IPython release drops Python 2.7 support by raiph on Tuesday April 25, 2017 @08:36PM (#14199542)
> making Perl 6 not be compatible with Perl 5.

Imo that's either inaccurate or misleading.

In Perl 6, `use` followed by a module name followed by a `:from` adverb leads Perl 6 to load the module, initialize it, and import its public functions, constants, variables, etc., AUTOMATICALLY BINDING THEM TO PERL 6, for any given supported other language the module is written in, provided someone has installed a suitable loader/binder (and the user has installed that plus the other language's interpreter, and the other language's module(s) that they wish to use).

I'll start with a toy example.

With a suitable "Perl 5" loader/binder in place, one could write the following and it would work as expected provided the user had installed the loader/binder, a compatible Perl 5 interpreter, and the Business::ISBN module (from https://metacpan.org/pod/Business::ISBN):

    use Business::ISBN:from<Perl5>;
    my $isbn = Business::ISBN.new( '9781491954324' );
    say $isbn.as_isbn10.as_string;
Stefan Seifert has written just such a Perl 5 loader/binder and steadily improved it over the last few years to the point it's a serious solution.

With Stefan's loader/binder, not only do toy examples like the above work, so do non-toy examples like writing controllers for the Catalyst MVC web framework even though Catalyst is large and complex, written in Perl 5 with XS (C lib) extensions, written without regard to Perl 6, and even though a controller has to be a subclass of a Perl 5 class provided by Catalyst.

Re:New IPython release drops Python 2.7 support by chromatic on Tuesday April 25, 2017 @09:25PM (#14199772)
This argument is disingenuous.

The same feature is available in any language with a decent FFI (must support loading an arbitrary shared library, marshalling/demarshalling data between languages, and invoking functions in the shared library).

This is possible in Python, Ruby, Java, Racket, Rust, Perl, Go, and plenty of other languages I'm forgetting or haven't used. Yet who would seriously argue that "Python is compatible with Perl" because you can embed libperl in a Python program?

You might as well argue that "Rakudo is compatible with libssl", for all the relationship Rakudo source code has with Perl source code.