|
|
Subscribe / Log in / New account

Cannon: Where are we in the Python 3 transition?

Brett Cannon continues his series of posts on Python 3 with a blog post likening the path of its adoption to the Kübler-Ross model (i.e. the five stages of grief). "Unfortunately people are running up against the classic problem of lacking buy-in from management. I regularly hear from people that they would switch if they could, but their manager(s) don't see any reason to switch and so they can't (or that they would do per-file porting, but they don't think they can convince their teammates to maintain the porting work). This can be especially frustrating if you use Python 3 in personal projects but are stuck on Python 2 at work. Hopefully Python 3 will continue to offer new features that will eventually entice reluctant managers to switch. Otherwise financial arguments might be necessary in the form of pointing out that porting to Python 3 is a one-time cost while staying on Python 2 past 2020 will be a perpetual cost for support to some enterprise provider of Python and will cost more in the long-term (e.g., paying for RHEL so that someone supports your Python 2 install past 2020). Have hope, though, that you can get buy-in from management for porting to Python 3 since others have and thus reached the "acceptance" stage."

to post comments

Problem not exclusive to Python...

Posted Dec 31, 2015 20:35 UTC (Thu) by gwolf (subscriber, #14632) [Link]

I have quite a bit of legacy Rails code. Rails 1.x/2.x (with Ruby 1.8) is a pain to port to a modern setting... And if it works, well, our instructions are to set up a VM with the right ancient software and keep it alive. I don't expect such software to remain in use by 2020, but would not be terribly surprised, as it has remained useful (and quite uneventfully) since ~2007...

Cannon: Where are we in the Python 3 transition?

Posted Dec 31, 2015 22:02 UTC (Thu) by arjan (subscriber, #36785) [Link] (5 responses)

I wonder if the Perl 6 transition will go any faster.... I suspect it won't (perl is often used for write-only software)

Cannon: Where are we in the Python 3 transition?

Posted Dec 31, 2015 23:02 UTC (Thu) by juliank (guest, #45896) [Link]

There will be no Perl 6 transition, it's an entirely different language from Perl 5.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 9:38 UTC (Fri) by codewiz (subscriber, #63050) [Link]

> I wonder if the Perl 6 transition will go any faster....

Unlike Python 2.x, Perl 5.x is not being frozen to push a transition onto its developer community. From dev.perl.org:

Perl 5.22.1external link is the current stable version of Perl. Perl 5 is actively maintainedexternal link and developed (git repository)external link by a large group of dedicated volunteersexternal link. Perl 5 will be developed and maintained for many years to come.

> I suspect it won't (perl is often used for write-only software)

This is gratuitous and unnecessarily inflammatory.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 12:00 UTC (Fri) by MarcB (subscriber, #101804) [Link] (1 responses)

You can migrate to Perl6 one module at a time. See https://github.com/niner/Inline-Perl5
There is no "flag day" like a switch to Python3 entails, i.e. no need to wait until all modules you use have been migrated.

In practice, the "use Foo::Bar:from<Perl5>" construct plus the "X::AdHoc"-exception should already be enough to migrate almost all of our in-house software in a "top-down" manner, i.e. convert the main script, then our own modules it uses, one at a time.

That being said, the management issue still applies. At the moment, I could not present a convincing "business case" to justify the migration work (also: we simply would not have the time). Our Perl5 code works fine, contrary to Internet wisdom it is actually readable and maintainable, obviously we have much more experience with Perl5 than with Perl6 and Perl5 is maintained for the foreseeable future.
(Now, if things like Moose or pseudo-type-checking-libraries did not exist, the switch would be easier to justify - but then, we most likely would have stopped using Perl a long time ago.)

This might all be very different in a year or so. Perl6 should have improved in performance, more modules should be natively available, hopefully Perl6 on JVM will have caught up to MoarVM again (and have some speed advantages), ...

IMHO Python would have been much better of, if they had done the same: Declare Python3 to be a completely new language (even though old code might work as-is) but enable it to interface seamlessly to Python2. The question is, if this would have been possible.

Cannon: Where are we in the Python 3 transition?

Posted Jan 6, 2016 18:20 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

> but enable it to interface seamlessly to Python2. The question is, if this would have been possible.

Possible? Probably. Easy? No. Python's interpreter is implemented with all kinds of global state (guarded by the infamous GIL) that shouldn't really be there in any better-designed engine. Look at Lua where every state-manipulating function takes a lua_State* parameter to manipulate rather than having some nebulous set of implicit parameters (import table, ). If Python had done the same thing, then the functions could just look at whether they have a Python2 or Python3 state and voilà, you're half way there. But instead, they valued the ability to continue using the same (well, similar) C API.

Cannon: Where are we in the Python 3 transition?

Posted Jan 2, 2016 0:44 UTC (Sat) by flussence (guest, #85566) [Link]

> (perl is often used for write-only software)

Contrast to the other camp of programming languages, which have no complaints because nobody uses them.

Do You Think Of IT As Strategic To Your Business?

Posted Dec 31, 2015 22:06 UTC (Thu) by ldo (guest, #40946) [Link] (14 responses)

Or do you think of it merely as an expense?

The answer to that is what separates the innovative companies from the ones still stuck on Windows XP and Internet Explorer 6. And Python 2.

Do You Think Of IT As Strategic To Your Business?

Posted Dec 31, 2015 22:18 UTC (Thu) by lambda (subscriber, #40735) [Link] (9 responses)

Sorry, I have a lot more time to innovate if I'm not having to port perfectly good, working code that does boring but necessary management tasks to a new language. Simply porting from Python 2 to Python 3 is just an expense, and the new features available aren't really enough to justify the expense.

Re: not having to port perfectly good, working code

Posted Jan 1, 2016 0:56 UTC (Fri) by ldo (guest, #40946) [Link] (8 responses)

In the real world, there is very little such code. Those “boring, but necessary management tasks” do not sit still. Circumstances are always changing, which is why you need to be agile and adaptable. Trying to keep the same old creaky code bumbling along with spit and baling wire will only get you so far.

Remember why you wrote the code in Python rather than, say, C or Java in the first place: it was because, being a higher-level language, it would make you more productive and the code becomes easier to maintain. That doesn’t mean you don’t have to maintain the code at all.

Re: not having to port perfectly good, working code

Posted Jan 1, 2016 8:04 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

> In the real world, there is very little such code. Those “boring, but necessary management tasks” do not sit still. Circumstances are always changing, which is why you need to be agile and adaptable. Trying to keep the same old creaky code bumbling along with spit and baling wire will only get you so far.
Why do you insult my perfect Python2 code?

Seriously, there are quite a lot of well-written systems in Python 2. They don't suddenly become creaky bumbling messes if Python developers extrude yet-another-version of Python 3.

Re: not having to port perfectly good, working code

Posted Jan 4, 2016 22:39 UTC (Mon) by pboddie (guest, #50784) [Link] (5 responses)

In the real world, there is very little such code. Those “boring, but necessary management tasks” do not sit still. Circumstances are always changing, which is why you need to be agile and adaptable. Trying to keep the same old creaky code bumbling along with spit and baling wire will only get you so far.

If anyone launching spacecraft had the same attitude to working code, nothing would ever leave the launchpad. In fact, nothing would even get as far as the launchpad. Now substitute for the space industry any one of many other more mundane industries that just want working systems without having to burn organisational resources just to retain their existing capabilities. (And why not substitute various other disciplines for software engineering, too?)

Of course, one can make observations about things being archaic and having severe limitations that don't seem to make sense any more, and one can make the case for improvements to those systems to make them more accessible and intuitive for developers and users (thinking of things like flight reservation and banking systems here). And one can also advocate that organisations should retain the capability of improving and adapting their systems.

But let us not pretend that a "technology provider"-mandated migration that is supposedly "good for you" (or any one of a number of questionable analogies used to advocate porting stacks of Python 2 code, in this instance), all for marginal benefit and at potentially significant cost, is fundamentally a necessary or desirable thing. It is, as was written earlier, an expense and a potential deterrent to the adoption of a technology in both its existing and its future forms.

Re: If anyone launching spacecraft had the same attitude to working code ...

Posted Jan 4, 2016 23:20 UTC (Mon) by ldo (guest, #40946) [Link] (4 responses)

... because keeping old software going is such a great idea...

Re: If anyone launching spacecraft had the same attitude to working code ...

Posted Jan 5, 2016 0:14 UTC (Tue) by bronson (subscriber, #4806) [Link]

Well, you know the old saying: if it ain't broke, don't waste developer time screwing around with it.

Re: If anyone launching spacecraft had the same attitude to working code ...

Posted Jan 5, 2016 0:19 UTC (Tue) by Wol (subscriber, #4433) [Link] (1 responses)

Which if you read the article, the fault occurred because they COULDN'T BE BOTHERED to test the code.

If the requirements don't change, don't change the code. The requirements changed and they didn't change the code ... oopssss!

And one of the BIG problems with IT, is its proponents are very much "ooohh shiny" about new toys - why should business expect to cough up loads of cash for new equipment, when the old stuff is working fine ? I'm minded of a story about when RS232 serial ports disappeared from new computers as a default - apparently when a end-user complained about needing them to drive a load of peripherals, the reaction (of Microsoft) was "just replace your peripherals". At $1/4M per peripheral (and quite a lot of them), that's an extremely expensive option!

New != Better !!!

Cheers,
Wol

Re: If anyone launching spacecraft had the same attitude to working code ...

Posted Jan 5, 2016 10:16 UTC (Tue) by smurf (subscriber, #17840) [Link]

Given the fact that $10 USB>RS232 adapters exist (OK, they were somewhat more expensive at the time, but not *that* much), that reaction is a major brain fart.

Re: If anyone launching spacecraft had the same attitude to working code ...

Posted Jan 5, 2016 13:57 UTC (Tue) by pboddie (guest, #50784) [Link]

What a cheap shot! The reason for that failure was, as someone else pointed out, the lack of testing when deploying the software on new hardware (and, indeed, a new launcher platform). But what you're advocating is just churn at every layer of the software stack - let us not even consider the hardware - because a bunch of people think that change for its own sake is good.

And yes, despite what people would claim here, it affects the Linux kernel, too. Because things like driver frameworks and other internals seem to change over time, meaning that developers have to either get stuff into the mainline kernel distribution (and hope it doesn't get flung out) or maintain their own fork indefinitely, both being "treadmill" kinds of tasks that ultimately prove unappealing when there are other demands on people's time and money.

Re: not having to port perfectly good, working code

Posted Jan 5, 2016 3:16 UTC (Tue) by jwarnica (subscriber, #27492) [Link]

Yes, at any given moment, you might only need to hack on 100 lines of your homemade version of puppet/chef/ansible. It mostly works, and has mostly worked for 10 years. The next 100 line hackathon can't be in Python 3 because it would mean at least touching the other 9900 lines of code that, while you want to throw away, can't, because it works.

Do You Think Of IT As Strategic To Your Business?

Posted Jan 1, 2016 20:39 UTC (Fri) by ovitters (guest, #27950) [Link] (3 responses)

I've written entirely useful stuff in VBA. It's pretty terrible structure wise as VBA limits things entirely. Some things you really don't need to fiddle around constantly. IMO "innovative companies" is buzzword bingo. Same for your suggestion that IT could solve everything. It's just one of the many factors.

Re: IMO "innovative companies" is buzzword bingo

Posted Jan 1, 2016 21:07 UTC (Fri) by ldo (guest, #40946) [Link] (2 responses)

Have you noticed that the successful companies are run by people who understand that concepts like “innovation” and “excellence” are not “buzzword bingo”?

When was the last successful company run by engineers?

Re: IMO "innovative companies" is buzzword bingo

Posted Jan 1, 2016 23:57 UTC (Fri) by Wol (subscriber, #4433) [Link]

Please define "successful".

I think Hewlett-Packard are a classic example of a company that went downhill when the engineers were forced out.

Yes the leaders need business nous, but, without solid engineering experience in the top leadership, any company that competes on merit is likely to get flattened. Notice I said "competes on merit" - unfortunately many seriously mediocre (or worse) companies prefer to compete on dirty tricks, and the average consumer doesn't realise what's going on.

Cheers,
Wol

Re: IMO "innovative companies" is buzzword bingo

Posted Jan 2, 2016 18:03 UTC (Sat) by jospoortvliet (guest, #33164) [Link]

Yeah, and in my experience, it is rarely the managers who understand 'innovation' and 'excellence', it is usually the engineers. Engineers believe that a good product sells itself, managers think that you can sell anything as long as you have lots of marketing and sales. Yes, both are wrong, but the managers more than the engineers. Unfortunately it's the managers who are in charge so often, 'innovation' and 'excellence' are just costs to be cut.

Cannon: Where are we in the Python 3 transition?

Posted Dec 31, 2015 22:24 UTC (Thu) by ibukanov (subscriber, #3942) [Link] (56 responses)

The presumption here is that porting is one-time cost. But this is rather optimistic given that Python already got incompatible changes twice and it could well be that by 2020 a porting efforts for Python 4 will be required again.

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 0:18 UTC (Fri) by ldo (guest, #40946) [Link] (39 responses)

A cost, or an investment?

Do you think of your code as something that, once built, remains static and unchanging thereafter? Or as something living and growing, needing regular care and feeding?

It seems to me that proprietary software tends to take the former attitude, while open-source projects are the latter.

Which one remains more agile, more adaptable to changing circumstances?

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 0:32 UTC (Fri) by sfeam (subscriber, #2841) [Link] (25 responses)

I fear that you are right about many open-source projects adopting the latter point of view, but this is a bad thing. If a codebase needs regular care and feeding just to continue working - that is a recipe for bitrot and eventual death. What one really wants is something else again - code that continues to work as before without any extra effort, while also continuing to grow in utility when care and feeding is available.

Oh, and ponies.

Re: but this is a bad thing.

Posted Jan 1, 2016 0:47 UTC (Fri) by ldo (guest, #40946) [Link] (24 responses)

On the contrary. Look at how active the most successful open-source projects are, like the Linux kernel and Blender, just to mention a couple close to my heart.

It is inaction that leads to bitrot and death.

Re: but this is a bad thing.

Posted Jan 1, 2016 1:04 UTC (Fri) by sfeam (subscriber, #2841) [Link] (9 responses)

I think your examples argue against your claim. The linux kernel is a standout example of putting an emphasis on backward compatibility and a guarantee that old code relying on it will continue to "just work" despite lots of spiffy new features in the kernel itself.

Python exemplifies the other extreme. Code written in Python is a sand castle built on shifting sand. It is at risk from every shiny new wave of change and will inevitably crumble as the tide comes in. If you have a large pail+shovel crew you can keep your castle looking good, but if the crew wanders off to play with other castles then by next Tuesday yours will be uninhabitable.

Re: will inevitably crumble as the tide comes in

Posted Jan 1, 2016 1:15 UTC (Fri) by ldo (guest, #40946) [Link] (5 responses)

No doubt Guido van Rossum heard many naysayers spout exactly that kind of hot air when he started developing Python in the early 1990s. Yet here we are, a whole generation later, and it has surpassed so many giants of that time, that seemed invincible back then, but that many people don’t even remember nowadays.

Re: will inevitably crumble as the tide comes in

Posted Jan 1, 2016 8:09 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

Python really took off in early 2000-s. Since then there were 4 major widely used versions in Python 2 series: 2.2, 2.4, 2.6 and 2.7

They were pretty compatible with each other, so that was actually a selling point compared to "let's rewrite the world" Ruby and "next-version-in-another-decade" Perl.

Re: will inevitably crumble as the tide comes in

Posted Jan 1, 2016 9:34 UTC (Fri) by jmtapio (guest, #23124) [Link] (3 responses)

Well, no. I have have been writing and maintaining code in Python since 2000 and have been through all the versions from 1.5 to 3.4. Almost every version update has required me to fix something. Sometimes it is things in core like divisions, getting rid of automatic casting, unicode, code encodings. Sometimes it has to do with database adapters adapting new language constructs like decimal and datetime (getting rid of mxdatetime was a lot of work for me). Sometimes it has to do with swapping out deprecated libraries. Oh and then there is every single WxPython or Django upgrade.

I think that not having to maintain stable software is a complete myth in the generic real world. Ok, you can have some limited functionality stuff that works pretty much everywhere. But that is the exception and not the norm.

Re: will inevitably crumble as the tide comes in

Posted Jan 2, 2016 0:06 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

Changes from 2.6 to 2.7 were pretty minor. You needed to adapt for them, but it was not that hard - just a couple of tweaks usually. And native C modules that not depending on any affected functionality continue working just fine between 2.x versions.

Both is false for Python3 - you have to carefully check all source code for incorrect string use and then you have to fix your native code modules.

Backwards compatibility in the real world

Posted Jan 2, 2016 19:41 UTC (Sat) by niner (subscriber, #26151) [Link]

"I think that not having to maintain stable software is a complete myth in the generic real world."

In the Python world maybe. In the past 15 years, the time we spent on getting our quarter million lines of code application to work on newer version of Perl can be counted in single digit hours. And this time was spent on fixing actual bugs that just by luck did not cause problems earlier.

Backwards compatibility is certainly possible when developers care about their users.

Re: will inevitably crumble as the tide comes in

Posted Jan 4, 2016 22:11 UTC (Mon) by pboddie (guest, #50784) [Link]

Cyberax wrote...

Python really took off in early 2000-s. Since then there were 4 major widely used versions in Python 2 series: 2.2, 2.4, 2.6 and 2.7

They were pretty compatible with each other

jmtapio wrote...

Well, no. I have have been writing and maintaining code in Python since 2000 and have been through all the versions from 1.5 to 3.4.

Well, 1.5 and 3.x are not part of the 2.x series. That's your problem right there with things like Unicode: it wasn't directly supported in 1.5 (but only in the 1.6 release equivalent to the 2.0 release), and is handled differently in 3.x. But what you're describing is problems with library evolution, albeit in response to new language features, where those libraries fail to uphold their existing semantics in later versions.

However, I would argue that such problems are a consequence of pressure to be seen to be doing the "right" thing in front of the language developers, sweeping away old but working approaches in a way that admittedly does allow a degree of code simplification, but which causes library users to make very difficult choices.

Re: but this is a bad thing.

Posted Jan 1, 2016 14:09 UTC (Fri) by smurf (subscriber, #17840) [Link]

The kernel is a perfect example how volatile a codebase can be. Its internals change a whole lot. Good luck getting a driver from 2014 to compile on top of today's kernel, you'll need it.

Fact of life: script languages change. Deal with it. Python is better than many others in this regard. At least when a Python program hits an unexpected condition, it crashes with an actual error message, instead of plodding along like a PHP or Perl script. I consider that to be a Very Good Thing.

Yes, the SSL thing was bad, but then you can choose between using SSL in a safe way or not using it at all. I'd rather see a crash than security theater.

Re: but this is a bad thing.

Posted Jan 3, 2016 10:59 UTC (Sun) by warmcat (guest, #26416) [Link] (1 responses)

''The linux kernel is a standout example of putting an emphasis on backward compatibility and a guarantee that old code relying on it will continue to "just work" despite lots of spiffy new features in the kernel itself.''

From the point of view of "old code relying on it" being kernel code... there is deliberately no attempt at backward compatibility whatsoever.

At least it'd be better if you put the word 'userland' in there somewhere.

Re: but this is a bad thing.

Posted Jan 3, 2016 13:17 UTC (Sun) by smurf (subscriber, #17840) [Link]

We're not talking about Python(-or-whatever) internals either – just the scripts written in the language.

Re: but this is a bad thing.

Posted Jan 1, 2016 1:05 UTC (Fri) by welinder (guest, #4699) [Link] (13 responses)

The kernel provides a very stable interface to its customers. There
might be daily grind on the inside, but its outside remains unchanged.

So the kernel is a find example for the opposite of your statement.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 1, 2016 1:22 UTC (Fri) by ldo (guest, #40946) [Link] (12 responses)

Backward compatibility in userland does not stop development of new APIs (e.g. sysfs, KMS), nor does it preclude reorganizations of the internal kernel architecture where this is seen as necessary for future enhancements.

There is a rule that no line of code goes into the kernel without some live, active maintainer who can respond to queries about that code. As Microsoft discovered to its cost.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 1, 2016 2:52 UTC (Fri) by butlerm (subscriber, #13312) [Link] (11 responses)

Python 3 is a new language. Not backward compatible. Every Linux kernel since the beginning provides a backward compatible interface on an application source level, an application binary level, or both. That is the policy anyway. No doing things like inventing a new kernel that won't support run of the mill programs written for older versions. That would be so different the result wouldn't really be Linux. Not as we know it.

By contrast, Python 3 is more different from Python 2 than Linux is from BSD. Far more different. A new creature, not designed to implement the same interface or (as I understand it) any general purpose subset thereof at all. If you want to write software and still have it running twenty years down the road, that could be a problem, albeit one easily solved by someone maintaining Python 2 indefinitely.

Re: Python 3 is more different from Python 2 than Linux is from BSD

Posted Jan 1, 2016 3:14 UTC (Fri) by ldo (guest, #40946) [Link] (1 responses)

Somehow I doubt that. Make up a list of the differences between Python 2 and Python 3, and another list of the differences between Linux and BSD: the latter would be a couple of orders of magnitude longer. Remember, Linux is up to 20 million lines of code now. Python is not.

Maybe you shouldn’t have mentioned BSD. That predates Linux by a long shot, in the way that Python 2 predates Python 3. Yet that community struggles to achieve the level of acceptance that Linux has managed. Nowadays, it is they who predominantly copy features from the Linux project, not the other way round.

There is something to be said for making a clean start, without feeling obliged to hang onto every bit of baggage from the past.

Re: Python 3 is more different from Python 2 than Linux is from BSD

Posted Jan 6, 2016 18:49 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

> Nowadays, it is they who predominantly copy features from the Linux project, not the other way round.

Well, Linux is also refusing (or just taking a long time) to take their (sometimes better) ideas. kqueue, forkfd, capsicum, and more. Other times Linux gets things inspired by the BSDs but having different tradeoffs (kqueue vs. epoll).

Re: The kernel provides a very stable interface to its customers.

Posted Jan 1, 2016 8:14 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

Python 3 is NOT a new language. It's the same old Python with all its warts (GIL, no true coroutines or continuations, slow GC).

But let's pretend that Py3 is a new language. Then why the old language is deprecated?

Re: The kernel provides a very stable interface to its customers.

Posted Jan 7, 2016 14:44 UTC (Thu) by pboddie (guest, #50784) [Link]

Python 3 is a different language, but perhaps only different enough to be inconveniently incompatible with Python 2. Meanwhile, as you note, CPython 3 - the virtual machine - is the same old CPython with all its inherent deficiencies.

Obviously, Jython is available as a Python 2 runtime without the GIL, or at least with some support for simultaneous execution of threaded code, and things like PyPy and Micropython also offer different trade-offs. I think I've noted many times that had Python 3 been about fixing the things that people struggled the most with when using Python, it would have kept language changes to a minimum and dealt with the GIL, GC and other implementation issues with CPython.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 1, 2016 14:20 UTC (Fri) by smurf (subscriber, #17840) [Link] (6 responses)

Well, that must be why, with some thinking and some magic fairy dust in the form of the "six" module, writing code that works with both Py2 and Py3 is rather straightforward.

Maintaining Py2 indefinitely is not "easy". Also, Python is no worse than other languages, compiled or not. Try compiling a C++ program from that time, or running an ancient PHP or Perl script. Good luck, you'll need it.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 2, 2016 0:14 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

I have numerous C++ programs from early 2000-s, they mostly compile just fine (unless they used bad template magic). Perl is also pretty compatible, I fixed a cgi-bin script from 2001 just yesterday.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 2, 2016 1:02 UTC (Sat) by flussence (guest, #85566) [Link]

In one comment above, you condemn PHP 5/7 and Perl 5 for defaulting to a backward-compatible lack of strictures, and praise Python 2 for making breaking changes in a point release.

In this one, you condemn them for having supposedly worse backward compatibility than Python.

???

Re: The kernel provides a very stable interface to its customers.

Posted Jan 2, 2016 8:11 UTC (Sat) by ibukanov (subscriber, #3942) [Link] (3 responses)

Out of experiment I run make against Makefile and C++ code from my master thesis from 1997. It compiled with warnings like:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/resources.C: In constructor ‘CrResources::CrResources(int&, char**, bool)’:
src/resources.C:22:39: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

src/resources.C:57:33: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

src/resources.C:168:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

src/main.C:177:12: warning: deleting object of abstract class type ‘ResourceSource’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]

The last one discovered a real bug but it should be harmless in this case. The resulting executable runs normally.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 3, 2016 17:36 UTC (Sun) by k8to (guest, #15413) [Link] (2 responses)

FWIW, I have plenty of C++ from that era that used to compile and work but no longer does.

(I didn't write that C++).

You can argue that the C++ code was never right, but I think C++ is definitely not a shining example of the language where code always keeps working. Now, I have a lot of C that still works from the 1980s.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 11, 2016 12:16 UTC (Mon) by khim (subscriber, #9252) [Link] (1 responses)

Have you tried to make that code compileable? Usually it takes few hours to add some define's here and there but when you finally convince said code to compile it run and works in 99.9% cases. Compare with Python2-to-Python3 transition where you need to actually carefully read and test each and every line of code.

Re: The kernel provides a very stable interface to its customers.

Posted Jan 11, 2016 22:33 UTC (Mon) by smurf (subscriber, #17840) [Link]

You should already have tests which run each and every line of code for you. :-P

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 0:50 UTC (Fri) by b7j0c (guest, #27559) [Link] (2 responses)

> Do you think of your code as something that, once built, remains static and unchanging thereafter? Or as something living > and growing, needing regular care and feeding?

For most companies, it isn't either, it is something like cattle...you want to make sure you aren't spending more on grain and water than the resulting beef will be worth.

In many situations, programs providing small marginal utility don't justify this level of care.

With container tech like Docker, its easier than ever to hide ugly dependencies away. Most people faced down with deteriorating dependencies will deal with it once in a Dockerfile and run out the clock.

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 7:08 UTC (Fri) by patrakov (subscriber, #97174) [Link] (1 responses)

> Most people faced down with deteriorating dependencies will deal with it once in a Dockerfile and run out the clock.

I'd rather watch what dies first: Python 2 or Dockerfiles in their current form.

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 12:25 UTC (Fri) by ibukanov (subscriber, #3942) [Link]

Once one dockerizes the app, it is simple to switch to other container format and it would not cost too much efforts. It is just the size of Dockerfiles is so much smaller than the codesize of a typical app.

The presumption here is that porting is one-time cost.

Posted Jan 1, 2016 1:17 UTC (Fri) by xtifr (guest, #143) [Link] (9 responses)

It's a cost.

Old code needs enough maintenance work to keep it up-to-date with changing requirements and such already! Needing to fix major portions of it because the language it's written in keeps changing randomly is just more pointless and annoying work. Even in open source projects.

People don't generally rewrite their C code every time a new version of the C standards come out. Fortunately, they don't have to, because the C standards guys are generally very good at maintaining backwards compatibility. C89 code still works fine with a C11 compiler. Aside from finally dropping gets() (which has been considered a bug for ages), I can't think of a single breaking change since the K&R->ANSI transition 25 years ago.

C++ has been much more unstable, but it looks like things may finally settling down. The only big thing I've seen recently that may _require_ source-code changes to old code is the replacement of auto_ptr with unique_ptr. Both are supported in C++11/14, but the former is supposed to be removed in C++17 (or so I've heard).

Other languages may lack the stability of good old C, but I can't really think of another _established_ language that's gone for wholesale random breakage of existing code the way Python did.

because the language it's written in keeps changing randomly

Posted Jan 1, 2016 1:24 UTC (Fri) by ldo (guest, #40946) [Link] (8 responses)

But that’s the point—the language didn”t change “randomly”, it had to change precisely because real-world requirements have changed.

The same sorts of changes in requirements affect your code as well, which is why you need to keep up to date.

because the language it's written in keeps changing randomly

Posted Jan 1, 2016 8:14 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (6 responses)

Stop making me laugh.

Python 3 fulfills no real-world driven requirements except for scratching developers' itches. Otherwise, they would have found a way to remove GIL and add a JIT-compiler.

because the language it's written in keeps changing randomly

Posted Jan 1, 2016 14:13 UTC (Fri) by smurf (subscriber, #17840) [Link] (2 responses)

People have. It's called PyPy. Not there yet (the "remove GIL" part is still a WIP, and PyPy3 is only up to 3.2) but looking good.

Removing the GIL is very easy. Just drop support for threading. You want to keep that module? good luck, you'll need it.

because the language it's written in keeps changing randomly

Posted Jan 2, 2016 0:12 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

No, it's not.

PyPy is working on STM which is supposed to be the new Messiah that will magically make everything better and even transform Python programs into optimized C++ code.

In reality, STM struggles with more than 4 cores and has a lot of limitations ( http://doc.pypy.org/en/latest/stm.html#current-status-stm... ). It's also pretty clear that it's never going to be as fast as regular threading for most of tasks.

because the language it's written in keeps changing randomly

Posted Jan 2, 2016 14:04 UTC (Sat) by smurf (subscriber, #17840) [Link]

Yeah, it has problems with more than four cores. But with the GILyou struggle with more than one core, so that's still a net win.

Re: Python 3 fulfills no real-world driven requirements

Posted Jan 1, 2016 20:45 UTC (Fri) by ldo (guest, #40946) [Link] (2 responses)

I have heard you say that before. Trouble is, lots of us have moved on to Python 3, and have no idea what you are talking about, or interest in moving back.

What you need to do is take some substantial piece of code written in Python 3, and rewrite it in Python 2 and show how it works just as well, or even better. That would help to demonstrate that you have a point. Otherwise you are just indulging in hand-waving hot air.

Re: Python 3 fulfills no real-world driven requirements

Posted Jan 2, 2016 0:20 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

> I have heard you say that before. Trouble is, lots of us have moved on to Python 3, and have no idea what you are talking about, or interest in moving back.
Yup. That's the problem, you don't even know (or pretend not to) understand the problems with large-scale porting efforts.

> What you need to do is take some substantial piece of code written in Python 3, and rewrite it in Python 2 and show how it works just as well, or even better. That would help to demonstrate that you have a point.
I did exactly this for http://python.projects.pgfoundry.org/ , it took about the same amount of time it takes to move Py2 to Py3. I probably can share the resulting code, if you want.

BTW, I did this to use PyPy because it didn't support Py3 or Py2 modules back then.

Re: Python 3 fulfills no real-world driven requirements

Posted Jan 7, 2016 17:15 UTC (Thu) by mathstuf (subscriber, #69389) [Link]

I was working on some code which used regular expressions heavily and Python2 was *way* faster than Python3 because 3 tries to cache the regex compilation (and I was compiling enough that I continued blowing the cache size and it kept having to expire "old" compilations). Apparently 3.5 fixed that behavior, but I still have it as dual Python2/Python3 so I can test PyPy.

because the language it's written in keeps changing randomly

Posted Jan 1, 2016 12:34 UTC (Fri) by mpr22 (subscriber, #60784) [Link]

Changes in "real world requirements" at large do not necessarily translate into changes in the real-world requirements of any given software project.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 0:58 UTC (Fri) by smurf (subscriber, #17840) [Link] (15 responses)

Python 4 will not require incompatible changes. Thus declareth the BDFL. (Though I can' remember where. This doesn't exclude removing deprecated code, but that caveat applies to any other 3.n => 3.n+1 transition.)

Re: Python 4 will not require incompatible changes

Posted Jan 1, 2016 3:29 UTC (Fri) by ldo (guest, #40946) [Link] (10 responses)

I wonder about that. The 4.0 version number would be a good point at which to make more backward-incompatible fixes to the language. Much as I enjoy using Python, it currently exhibits a few instances of brain-damage that come to mind:

  1. That pathetic excuse for a conditional expression. What was wrong with C-style “cond ? true-branch : false-branch”?
  2. The yield construct was originally supposed to be simpler than a full-scale coroutine system. But the addition of yield-from in Python 3.3 shows the deficiencies of that approach—it would not have been necessary if Python had proper coroutines to begin with.

    Or, even better, why not subsume them (along with exceptions) into full-fledged continuations?

  3. And yes, it has to be mentioned—the attachment of significance to amounts of whitespace. This has so many problems:
    • Inconsistency—it applies to compound statements, not to expressions
    • Loss of redundancy, in that you now only have one set of clues as to the structuring of the code (indentation) as opposed to two available in other languages (indentation and bracketing). I have lost count of the number of times I have seen Python code posted on web pages or reader comments where the indentation got mangled. In other languages, the code may be difficult to read, but it will usually still work. But in Python, it turns into unrecoverable gibberish.

Re: Python 4 will not require incompatible changes

Posted Jan 1, 2016 14:38 UTC (Fri) by smurf (subscriber, #17840) [Link] (9 responses)

Whitespace? Do you have any idea how often wrongly-indented code bites C programmers? Not to mention the additional time required to keep the two in sync.

One conditional expression is as good as any other. The semantics are the same. Expressing this thing in English has the same structure as Python.

You can't do continuations because Python is not just CPython and some VMs simply do not and never will support first-class continuations. That was a deliberate design decision. "yield from", or Py3.5's async/await evolution of that concept, is as good as we're going to get and, frankly, they're a lot easier to understand and debug than anything using call/cc.

Re: Do you have any idea how often wrongly-indented code bites C programmers?

Posted Jan 1, 2016 20:48 UTC (Fri) by ldo (guest, #40946) [Link] (3 responses)

Having done my share of C programming, yes.

And having participated in online discussions involving code in Python and other languages, I have seen how it bites the Python code much more often.

Never forget that the human propensity for screwing things up is practically infinite. Having a bit of redundancy in the code structuring (i.e. expressing it both in bracketing and indentation) helps to mitigate that somewhat. Chucking away that redundancy is not a good idea.

Re: Do you have any idea how often wrongly-indented code bites C programmers?

Posted Jan 1, 2016 23:39 UTC (Fri) by anselm (subscriber, #2796) [Link] (2 responses)

The problem with that idea is that in languages like C, indentation doesn't actually provide useful redundancy because the compiler ignores it completely. Hence you can have pieces of code that suggest one thing to a human reader but mean something quite different to the compiler, along the lines of

if (conditionA)
     if (conditionB)
          foo();
else
     bar();

You can of course try to work around this with style guides that mandate braces, or automatic reformatting of source code when it is checked into a VCS, but Python avoids this type of ambiguity altogether to begin with because both human readers and the language interpreter only look at the indentation to infer program structure.

Re: indentation doesn't actually provide useful redundancy

Posted Jan 1, 2016 23:57 UTC (Fri) by ldo (guest, #40946) [Link]

It provides redundancy for human readers. A discrepancy between the bracketing and the indentation can at least ring some alarm bells.

Luckily, in Python, you can at least put back the redundancy the other way—this time, the bracketing symbols, in the form of “#end” comments, are the things being ignored by the compiler.

This is how I write my Python code.

Re: Do you have any idea how often wrongly-indented code bites C programmers?

Posted Jan 5, 2016 11:41 UTC (Tue) by jezuch (subscriber, #52988) [Link]

> Hence you can have pieces of code that suggest one thing to a human reader but mean something quite different to the compiler, along the lines of...

And that's why the coding style guidelines in my team prohibit "bare" statements like these. Use braces everywhere or die by checkstyle ;)

Re: One conditional expression is as good as any other

Posted Jan 1, 2016 21:13 UTC (Fri) by ldo (guest, #40946) [Link] (4 responses)

Every other conditional construct in the world puts the condition before the true- and false-branches, not between them. Having the condition in-between makes no sense at all.

Python already copied things from C, like “=” for assignment and “==” for equality, instead of “:=” and “=” respectively as in the Algol family. (I’m old enough to still be wistful about that from time to time.) Why did it have to invent its own form of conditional expression?

Other things that Python does differently, it does differently for a good and useful reason (e.g. range() including the first bound but not the second). But the rationale for the design of its conditional expression seems completely lacking.

Re: One conditional expression is as good as any other

Posted Jan 7, 2016 17:48 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (3 responses)

What language doesn't use a half-open range function (given a range function to begin with that is)?

Re: One conditional expression is as good as any other

Posted Jan 8, 2016 9:46 UTC (Fri) by mbunkus (subscriber, #87248) [Link]

Perl's and Ruby's range operators .. are both inclusive the end:

[0 mbunkus@chai-latte ~] perl -le 'print $_ for (0..2)'
0
1
2
[0 mbunkus@chai-latte ~] ruby -e '(0..2).each { |i| puts i }'
0
1
2
[0 mbunkus@chai-latte ~]

Re: One conditional expression is as good as any other

Posted Jan 8, 2016 12:39 UTC (Fri) by niner (subscriber, #26151) [Link] (1 responses)

Perl 6 supports both:

nine@sphinx:~> perl6 -e '.say for 0..3'
0
1
2
3
nine@sphinx:~> perl6 -e '.say for 0..^3 # read "up to three"'
0
1
2
nine@sphinx:~> perl6 -e '.say for ^3 # read "short version"'
0
1
2

Re: One conditional expression is as good as any other

Posted Jan 8, 2016 19:38 UTC (Fri) by bronson (subscriber, #4806) [Link]

Ruby too:

irb(main):003:0> (1..3).to_a
=> [1, 2, 3]
irb(main):004:0> (1...3).to_a
=> [1, 2]

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 7:38 UTC (Fri) by allesfresser (guest, #216) [Link]

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 12:09 UTC (Fri) by ibukanov (subscriber, #3942) [Link] (2 responses)

Can one guarantee that BDFL would not change in, say, 4 years? I thought that Python community learned from 1.* ->2.* transition until I realized the amount of breakage Python 3 allowed.

Cannon: Where are we in the Python 3 transition?

Posted Jan 2, 2016 17:33 UTC (Sat) by kvaml (guest, #61841) [Link] (1 responses)

I do not recall any difficulties in transitioning from Python 1.x to Python 2.x. As best I can recall, the motivation for the renumbering was a license change. While Python2 had improvements, I do not remember any breakage of old code.

Cannon: Where are we in the Python 3 transition?

Posted Jan 3, 2016 17:45 UTC (Sun) by k8to (guest, #15413) [Link]

The biggest pain was how deeply entrenched Red Hat's installer was with python 1.x which led to python 1 being the default on Red Hat for around 5 years into python 2. That made a lot of pain for developers who wanted to ship a #!/usr/bin/python file and have it work, when they couldn't know if they'd get the ancient 1.5 featureset or something relatively modern.

But that's not a backwards incompatibility problem.

Indeed, looking through https://www.python.org/download/releases/2.0/ I see no backwards incompatible changes.

Cannon: Where are we in the Python 3 transition?

Posted Dec 31, 2015 22:46 UTC (Thu) by ledow (guest, #11753) [Link] (1 responses)

When there are BOOKS on how to convert from v2 to v3, there's something wrong.

Sure, we all know that an API can't have 20-20 vision into the future, and that some things have to be deprecated and changed, but when you are touting something as "just another version", then create documents that can't be close to summarised (the best I can find is: http://python-future.org/compatible_idioms.html and just look how long that page is) about what changes are required, and then complain that people aren't all flooding over to the new version, you are doing something wrong.

The only Python-based programs I used are all broken on a regular basis anyway. Nobody seems to care. For instance, Emscripten has a python installer that relies on Python 2.7 and urllib2, which doesn't work out of the box on some Ubuntu versions because the code changed for connecting to SSL sites and NOBODY bothered to patch it. I can't say I blame them, as at one time the code worked perfectly fine. But even where it's got fixes suggested for it, people are doing things like just overriding the way the whole Python interpreter treats that code, or forcing SSL by overloaded functions, etc. rather than fix the underlying problem.

I honestly think that if you can't transition in a safe way, with only minor inconvenience, that doesn't break the majority of programs (even if that means printing red stderr warnings in all-caps on the use of certain constructs), then your transition just isn't going to happen.

Programs will instead die because they have broken. Then people will rewrite them. And if you have to rewrite them, why would you bother doing it in the same language, you're much more likely to just use the current language-of-the-moment that hasn't yet broken itself several times over.

Such major problems only hint at COMPLETE lack of forethought about how the language needs to work, rather than a planned and sensible evolution of the language.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 0:52 UTC (Fri) by smurf (subscriber, #17840) [Link]

Yeah, hindsight is 20/20. Languages evolve, and fixing past mistakes isn't always that easy. Neither is knowing beforehand which approach works. One could have guessed that 2to3 would not work and syntactic compatibility between 2.7.x and 3.y was required for the transition to gain any traction, but nobody _knew_, thus an on-off translator seemed more feasible than waiting for three sub-releases for the "common source" approach to become reasonably feasible.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 0:02 UTC (Fri) by iabervon (subscriber, #722) [Link]

Having gone from 2.4 to 2.6 to 2.7 at work, it's been awfully pleasant not to change minor versions since then. It's a bit awkward that, in 2019, Python 2.7.x will still be supported, but Python 3.5.x probably won't. Also, everybody at work has been using Python 2.7 for so long that they've forgotten how to handle minor version transitions, so it'll be a big pain to go back to using a major version that gets new minor versions.

Still, the first reason we found not to adopt Python 3 for our latest project was that other groups' company-specific libraries didn't support it, and their development effort is going into REST APIs to their services rather than porting libraries.

It will never happen

Posted Jan 1, 2016 0:43 UTC (Fri) by b7j0c (guest, #27559) [Link] (23 responses)

Enough people won't or can't upgrade that it is safe to say that both of these languages will exist in parallel for at least another decade. To make it official, someone should just fork python2 and create a real community around maintaining it. There's no value to the developer community of users to having python2 go unmaintained.

Lesson learned: if you want to community to follow you to the future, backwards-compatibility is non-negotiable.

If python3 had supported all python2 programs without error or warning, 95% of python developers would be at or near the latest version.

It will never happen

Posted Jan 1, 2016 1:27 UTC (Fri) by dskoll (subscriber, #1630) [Link]

if you want to community to follow you to the future, backwards-compatibility is non-negotiable.

That should be Quote of the Week.

Re: f you want [the] community to follow you to the future

Posted Jan 1, 2016 1:58 UTC (Fri) by ldo (guest, #40946) [Link] (21 responses)

Where is there a Python 2.x “community”? All I see is a bunch of passive users wringing their hands over their piles of mouldering legacy code. A “community” is an active grouping of people contributing to ongoing development—people who give, not just receive.

In this sense, the Python “community” has clearly moved to Python 3.x.

Re: f you want [the] community to follow you to the future

Posted Jan 1, 2016 3:18 UTC (Fri) by rgmoore (✭ supporter ✭, #75) [Link] (13 responses)

Where is there a Python 2.x “community”?

It seems to me that the underlying problem is that there are really two relevant Python communities: the language designers who write Python and the programmers who program in Python. There apparently isn't enough overlap between the two groups, so that the developers are ignoring the desires of the programmers, and the programmers appear not to have the capability of taking over maintaining Python 2.x so they can keep their backward compatibility. Dismissing the programmers as a bunch of passive users isn't helpful; a language needs both groups to be really successful.

Re: dismissing ... a bunch of passive users isn't helpful

Posted Jan 1, 2016 4:31 UTC (Fri) by ldo (guest, #40946) [Link] (12 responses)

I don’t know what else you are supposed to do with them. There is a saying in the open-source community: “the one who writes the code makes the rules”. The ones who contribute (code, documentation, support, whatever) are the ones who have a say in the direction of the project; the ones who don’t, don’t.

Re: dismissing ... a bunch of passive users isn't helpful

Posted Jan 1, 2016 5:19 UTC (Fri) by sfeam (subscriber, #2841) [Link] (6 responses)

What those users would contribute, if they were listened to, is a requirement for stability or at least backwards compatibility. That is a contribution of policy or design (or management insight or vision) rather than one of code but it would nevertheless be a real contribution. In practice they can't make that contribution, because the group of people futzing around with the language itself isn't interested in receiving it.

Sure - “the one who writes the code makes the rules” - but if those rules make life hard for downstream users don't be surprised if they gradually go elsewhere. I say this as someone responsible for managing a couple of medium sized projects that have been burned by Python's instability. The lesson I learned was to veto choosing Python for new projects, and to the extent we have resources for porting old code I recommend migrating away from Python altogether rather than moving to Python 3.

Re: don't be surprised if they gradually go elsewhere

Posted Jan 1, 2016 6:38 UTC (Fri) by ldo (guest, #40946) [Link] (5 responses)

I’ve got news for you: they never came here in the first place.

Who is going to bother to work, for free, supporting old legacy code for users who are too cheap to upgrade? Nobody.

Re: don't be surprised if they gradually go elsewhere

Posted Jan 1, 2016 12:05 UTC (Fri) by khim (subscriber, #9252) [Link] (4 responses)

Who is going to bother to work, for free, supporting old legacy code for users who are too cheap to upgrade? Nobody.

Well, nobody except for developers of C, C++, C#, Go, Java, JavaScript, Perl5, PHP, and many-many other languages. Note that two last languages were burned by an attempts to introduce incompatible change and did the right thing. As for Python? The only thing you need to know about it: don't. Don't use it if possible and especially don't use Python3 for anything ever. You'll be happier that way.

I still don't understand why this lesson is so hard to understand for developers of Python. Perl5 developers realized what happens first: Perl5 was developed in parallel to Perl6 and they only needed to decide that it'll continue to be the case in the future - indefinitely. PHP6 was never all that important for the PHP developers and users never actually felt the need to switch, thus it's abandonment was an easy decision. Python… python is in bad shape there: it's developers are still pretending that they could change the fate and shove the unwanted and pointless changes into the language. Their only hope (and I mean only) is that people will adopt it like scientific truth is adopted: A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. I guess eventually, after maybe two or three decades, Python3 will became “a standard version of Python”, but it'll happen not because people will switch to it, but because new people will come and for them Python3 will be the only version they knew for a long time (in schools, universities, etc). The extemely naive hope that people will start adopting Python3 because Python2 support time will end is just stupid: it's not that hard to support a package (especially since for real users “support” here does not mean “we'll need to decide what changes to adopt and what to drop” but rather “we'll change the code when and if it'll be needed to make sure old version is still buildable on new systems”), it could be done for decades for sure.

Only time will tell what happens to python in the next 20-30 years when people will finally switch to Python3. My guess would that it'll become just another “legacy” platform because of that transition and join cool ranks of Cobol and Perl anyway… but who knows, it's looong time.

Re: don't be surprised if they gradually go elsewhere

Posted Jan 1, 2016 14:41 UTC (Fri) by nix (subscriber, #2304) [Link]

Quite. Where computer languages are concerned, "too cheap to upgrade" to an incompatible version is tantamount to "too cheap to rewrite everything". Who is "too cheap" to do that? Everybody.

Re: don't be surprised if they gradually go elsewhere

Posted Jan 1, 2016 16:04 UTC (Fri) by welinder (guest, #4699) [Link]

Heh. Aren't you the one who usually sees nothing wrong with the constant API and ABI breaks in Gtk+?

Re: Don't use [Python] if possible and especially don't use Python3 for anything ever

Posted Jan 1, 2016 20:38 UTC (Fri) by ldo (guest, #40946) [Link]

You are too late. I learned Python back around 2.4 or so (after a few years with Perl and a brief dalliance with Tcl), and gradually moved to the 3 series by around 3.3. It is my language of first preference for new projects. I saw the 2→3 transition as a good thing, and a necessary thing. if you hate it, don’t use it, by all means. But don’t waste your time trying to claim it is going to be a bad experience for me, because it wasn’t.

Re: don't be surprised if they gradually go elsewhere

Posted Jan 6, 2016 20:39 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

> “we'll change the code when and if it'll be needed to make sure old version is still buildable on new systems”

Just as a note, Python 2 only (officially) supports Visual Studio 2008 as its newest compiler on Windows[1]. Luckily, it is C, so you can compile-and-forget-it and just ship those binaries when the rest of your code grows up, but it is still a significant burden since finding the Express edition is non-trivial (nevermind a 64-bit toolchain if you need it). Importing the project into 2013 was a colossal failure (whether the fault of Visual Studio or something wrong in the project files is up for debate). Even bumping it to 2010 would be a great life saver for many people.

[1]https://docs.python.org/2/using/windows.html#compiling-py...

Re: dismissing ... a bunch of passive users isn't helpful

Posted Jan 1, 2016 17:31 UTC (Fri) by rgmoore (✭ supporter ✭, #75) [Link] (4 responses)

A big thing that ordinary programmers contribute are the universe of libraries that extend from its core features into the realms of problems that programmers need to solve. Without those libraries, a language is mostly a toy. The big risk of breaking compatibility is that it also breaks compatibility for those libraries, which leaves you with a language that doesn't fulfill it's basic purpose of letting people get their work done.

Re: ordinary programmers contribute ... the universe of libraries

Posted Jan 1, 2016 20:41 UTC (Fri) by ldo (guest, #40946) [Link] (3 responses)

I’m not aware of any important ones that are not already available for Python 3. The core libraries are all there. I use Blender a lot, and that has required Python 3 for a long while now (and just recently moved to 3.5). Database stuff, web stuff, graphics stuff ... all there.

Re: ordinary programmers contribute ... the universe of libraries

Posted Jan 1, 2016 23:17 UTC (Fri) by barryascott (subscriber, #80640) [Link] (2 responses)

Sadly wxPython is still not available with a stable py3 release. This was blocking my convertion to py3.

But I solved that problem another way. I ported my code from py2+wxPython to py3+PyQt5, and it was
a straight forward refactor. Indeed the Qt code is far cleaner then the wxPython version.
And moving from py2 to py3 is not hard in my experience and I have cleaner code as a result.

Re: ordinary programmers contribute ... the universe of libraries

Posted Jan 3, 2016 17:52 UTC (Sun) by k8to (guest, #15413) [Link] (1 responses)

That's not very surprising. wxwindows has always been a warty beast, and it's sort of unavoidable because of the problems it inherits from its fundamental goal of sitting astride different widget libraries.

I suppose the value of wxwindows has faded as Qt has become increasingly good at abstracting the native platform issues and foibles. May the Qt project live long and healthily!

Re: ordinary programmers contribute ... the universe of libraries

Posted Jan 4, 2016 12:22 UTC (Mon) by renox (guest, #23785) [Link]

> I suppose the value of wxwindows has faded as Qt has become increasingly good at abstracting the native platform issues and foibles.

Only if the language which you use has good binding for Qt!
AFAIK only Python and (obviously) C++ have good binding for Qt whereas wxwindows can be used from many more languages..

Re: f you want [the] community to follow you to the future

Posted Jan 1, 2016 8:16 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

Python 2 is OK as-is. It's been debugged by hard production use throughout the last 7 years or so and is pretty much maintenance-free.

Most of the actual interesting development is concentrated in library code, and Py2 is very much alive and kicking there.

Oh, and don't forget that the second major Python implementation (PyPy) still barely supports Py3.

Re: f you want [the] community to follow you to the future

Posted Jan 1, 2016 22:47 UTC (Fri) by b7j0c (guest, #27559) [Link]

> In this sense, the Python “community” has clearly moved to Python 3.x.

Except for the ones who have moved on to Go, Swift and even Java so they can be part of the modern era

Python3 is worthless in the modern era for anything but the most trivial scripting tasks. It brings nothing to the table and is hopelessly lagging, by decades, the capabilities of its peers

Re: f you want [the] community to follow you to the future

Posted Jan 2, 2016 1:20 UTC (Sat) by flussence (guest, #85566) [Link] (3 responses)

> In this sense, the Python “community” has clearly moved to Python 3.x.

What's left of it, if you're representative of how it treats its own. I thought pythons weren't venomous snakes.

Re: if you're representative of how it treats its own

Posted Jan 2, 2016 1:51 UTC (Sat) by ldo (guest, #40946) [Link] (2 responses)

Oh dear. I did hope we could keep the ad-hominem bullshit out of this discussion...

Your attempt to make things personal is an admission that you have run out of rational things to say.

Re: if you're representative of how it treats its own

Posted Jan 2, 2016 2:48 UTC (Sat) by flussence (guest, #85566) [Link]

> Your attempt to make things personal is an admission that you have run out of rational things to say.

And repeatedly trying to bash Python 2 users over the head with the idea that they're so insignificant they might as well not exist isn't?

The only thing I admit is that rationalizing in the face of such sheer arrogance is a waste of *anyone's* time.

Re: if you're representative of how it treats its own

Posted Jan 2, 2016 5:48 UTC (Sat) by viro (subscriber, #7872) [Link]

For fsck sake, would you quit morphing the subject line already?

*plonk*

Re: f you want [the] community to follow you to the future

Posted Jan 11, 2016 16:01 UTC (Mon) by rpcope1 (guest, #100731) [Link]

> Where is there a Python 2.x “community”? All I see is a bunch of passive users wringing their hands over their piles of
> mouldering legacy code. A “community” is an active grouping of people contributing to ongoing development—people who give, not just receive.

> In this sense, the Python “community” has clearly moved to Python 3.x.

You know, I'm simply one data point, but my employer maintains a rather sizable codebase (many hundreds of thousands of lines of Python 2.x) with lots of new code being produced and no clear path to migrating to Python 3.x in the near future; we are also a "tech" company, so this probably means we ahead of a lot of other users of Python. Even a lot of the high performance greenfield work I have been doing is yet again limited to 2.x because PyPy's support for 3.x is limited at best. I can't speak for the community at large, but to say that no "significant community" is interested in 2.x at the current time, is perhaps an overstatement.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 3:28 UTC (Fri) by khim (subscriber, #9252) [Link] (1 responses)

From looking on the article it does not look like Python3 is even looking on the right numbers. To me transition from Python2 to Python3 does not really resemble transition from Perl5 to Perl6 but more like transition from Visual Basic to Visual Fred.

Once upon time Visual Basic was one of the most popular languages out there. Some even claim is was the most popular language for development. When Visual Basic was declared dead and new, completely incompatible version (derisively called Visual Fred) was pushed as possible replacement Visual Basic developers have passed all these stages of Kübler-Ross model but eventually, of course, they all have reached “acceptance” phase and they have switched… to C#, Java, JavaScript, heck, some even picked Python! Today Visual Basic community is very pale shadow of it's former self. It's still one of top ten languages, but if you'll actually look on the tiobe index you'll find to your great surprise that regular Visual Basic is still about half-as-popular as it's newer cousin! And, remember, we are talking about proprietary, Windows-only language only available in binary form which was declared dead seven years ago!

Python 2.7 is not like Visual Basic. It's open-source project which could be compiled on any reasonably decent version OS. I don't understand why “people will need to pay for Python 2 support”? You could always just grab latest version and use it. Or maybe even better: just stick with some tested and working version (2.7.8 looks good). Heck, even today it's often not a good idea to even use latest version because (as was noted above) it already breaks stuff.

Cannon: Where are we in the Python 3 transition?

Posted Jan 1, 2016 18:44 UTC (Fri) by b7j0c (guest, #27559) [Link]

> Or maybe even better: just stick with some tested and working version (2.7.8 looks good).

Exactly. I predict many Python2 users will just freeze at a stable version and run out the clock, and then move on to an entirely new stack at some point in the future....which likely won't be Python* at all

Look at the most invested users

Posted Jan 1, 2016 11:29 UTC (Fri) by job (guest, #670) [Link] (6 responses)

As long as the biggest companies with the most invested in Python stick with Python 2, that's where maintenance will likely be cheapest. Google would have no problem maintaining a Python 2.8 release single handedly, and Dropbox even has Guido on staff. I wouldn't be surprised if Python 2.7 gets bugfixes much longer than 3.5.

Re: As long as the biggest companies ... stick with Python 2

Posted Jan 2, 2016 0:05 UTC (Sat) by ldo (guest, #40946) [Link] (5 responses)

And if they did that, they would abandon all hope of benefitting from future network effects.

Remember why Free Software has been so successful in the first place: it’s because no one company, no matter how big, can match the resources of an entire active community of users, developers, documentors and other contributors. Any company that forks off the code into its own private version can say goodbye to that.

Re: As long as the biggest companies ... stick with Python 2

Posted Jan 2, 2016 0:44 UTC (Sat) by job (guest, #670) [Link] (4 responses)

I don't think it has to come to that. Python 2 has an order of magnitude larger user base than 3.

Re: 2 has an order of magnitude larger user base than 3

Posted Jan 2, 2016 1:22 UTC (Sat) by ldo (guest, #40946) [Link] (3 responses)

Like I said elsewhere, the user base alone is not what counts, it’s the community.

Re: 2 has an order of magnitude larger user base than 3

Posted Jan 4, 2016 8:48 UTC (Mon) by linuxrocks123 (subscriber, #34648) [Link] (2 responses)

Python 2 has a community. Look at StackOverflow if you don't believe it. The Python 2 community consists of every major library developer that still supports Python 2, and every major company invested in it that has a stake in it continuing to work.

That's a big community, but Python 2 only needs a small one to keep going. The Python 2 standard library is vast and will not be going away. The external library developers supporting Python 2 will likely continue to do so as long as there is demand; for those that don't, porting from 3 to 2 is fairly easy since 3 really just screwed things up and didn't actually add many meaningful improvements to the language. A small community can handle the rare cases where some jerk decides to stop supporting Python 2 out of spite and a fork is necessary. I see a long, bright future for Python 2.

There was no reason Python 3 needed to exist as a fork of the language. Saying it was necessary to make backward-incompatible changes to the language to improve it betrays an extreme lack of imagination. For an example of a language handling major improvements in a grown-up manner, take a look at C++11.

Re: 2 has an order of magnitude larger user base than 3

Posted Jan 5, 2016 10:39 UTC (Tue) by smurf (subscriber, #17840) [Link] (1 responses)

So how would you replace a string class that can be auto-converted to binary, with one that needs an explicit .encode()? Add a flag?
Then what happens if you pass that string to a library which doesn't yet do that, and which isn't tested against these newfangled things?

I'm not saying that this is an unsolvable problem, but simply stating that there's "no reason" is wrong. You may not accept the Py3 authors' reasoning why they thought a new version is unavoidable, and in hindsight (given six.* and a couple of changes to both Px3 and 2.7.x) they might even retroactively change their mind, but at the time the situation was different – and we still don't have time machines.

Re: 2 has an order of magnitude larger user base than 3

Posted Jan 5, 2016 12:48 UTC (Tue) by job (guest, #670) [Link]

Seeing that Python 2 already has several types of string, would adding another string type really be that bad?

Sure, you would have to wait until your libraries handled it to use it (use polymorphism for backwards compatibility), but at least it would have been possible to keep the ecosystem of code.

Cannon: Where are we in the Python 3 transition?

Posted Jan 2, 2016 0:11 UTC (Sat) by kiko (subscriber, #69905) [Link]

FWIW Canonical has made this a priority for our own products and engineering teams, and MAAS will be fullly transitioned to Python 3 for the upcoming 1.10 release. There is a lot of work underway to drop Python 2 from the default installation profiles for Ubuntu 16.04 LTS; the page at https://wiki.ubuntu.com/Python/FoundationsXPythonVersions goes over some of the work in more detail.

Cannon: Where are we in the Python 3 transition?

Posted Jan 2, 2016 23:04 UTC (Sat) by njs (subscriber, #40338) [Link] (3 responses)

It's so weird to come in here and read all these apocalyptic comments. I work on a bunch of high-profile FOSS Python projects, with a bunch of other people who also work on high-profile FOSS Python projects, and day-to-day the attitude is "python 3 is awesome, let's just finish switching over". We use python 3 for teaching, software carpentry is running literally hundreds of classes every year teaching python 3, django's steering new users to python 3 in their tutorial, about 25% of our users are on python 3 already... targeting both as a package developer is pretty trivial once you get used to it, and the idea that the python devs care nothing about backcompat and that point releases are constantly breaking things is just bizarrely false.

Obviously this is mostly a matter of looking from different perspectives, and possibly "perspective" is the thing that internet comment sections are most pessimized for, but figured I'd throw this in at the bottom of the pile in case anyone reads that far :-).

Cannon: Where are we in the Python 3 transition?

Posted Jan 4, 2016 18:08 UTC (Mon) by k8to (guest, #15413) [Link]

Thanks for the additional perspective.

This is mostly how I view it in the open source world. In the commercial world of the app I dayjob on, python3 is not on the horizon because we have a large body of legacy code we're not actively working on. That's a smell in general but so it goes...

Cannon: Where are we in the Python 3 transition?

Posted Jan 5, 2016 7:47 UTC (Tue) by abartlet (subscriber, #3928) [Link] (1 responses)

For Samba, Python3 is, as far as I can tell, almost 100% cost. Perhaps the only benefit is that where we have outside contributors working to make Samba's python bindings (CPython interfaces specifically) we can ask that they add additional tests to cover the code they are changing. The balance is that like all code changes, it comes with risk, and it appears even the baby steps taken so far (making some support libraries work with Python2 and Python3) have already caused regressions.

While some may say that means we are still at the 'denial' stage, I would counter that we feel the Python3 advocates have for so long been in denial about the make-work being enforced on other projects. I'm glad to finally see some involved in Python writing that, given hindsight, the execution of the transition didn't go well, because I'm a bit sick of it being seen as some moral obligation to forward port our codebase to the new language.

As it is, the drivers and implementers of the transition have been the Linux distributions (alone). That Red Hat staff are both those preparing the Python3 patches and maintaining RHEL, which doesn't ship Python3, is a particular irony. (Samba is an important piece of enterprise software, so what ships on RHEL matters a lot in terms of what we can depend on. It also makes the claims that Python2 will go unsupported any time soon look silly, as Red Hat will have no choice for most of another decade).

I don't just speak from this as an observer: Samba faced a similar choice, and looked over the same cliff. We decided we couldn't abandon our users, or leave backward compatibility behind, even for a far better architecture. We avoided this option, and spent engineer-years merging the efforts within Samba to build Samba 4.0, with both new features and the old.

Cannon: Where are we in the Python 3 transition?

Posted Jan 5, 2016 14:12 UTC (Tue) by pboddie (guest, #50784) [Link]

While some may say that means we are still at the 'denial' stage, I would counter that we feel the Python3 advocates have for so long been in denial about the make-work being enforced on other projects. I'm glad to finally see some involved in Python writing that, given hindsight, the execution of the transition didn't go well, because I'm a bit sick of it being seen as some moral obligation to forward port our codebase to the new language.

I also find it interesting that there's been this more recent "messaging" about how people should start asking other people for money to keep supporting Python 2.x code, targeting those users who don't want (or who aren't ready) to move to Python 3. Meanwhile, the "make-work" of porting stuff to Python 3 - breaking and then unbreaking code that already worked - was something that everyone had to do for free.


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds