When to Switch to Python 3.8
pythonspeed.com
pythonspeed.com
https://twitter.com/indygreg/status/1187069501424062464
Mercurial was in fact one of important reasons for why the Python 2 deprecation was pushed back five years. We met with Guido at Pycon 2014 in Montreal and asked for an extension, which he granted. Back then Python itself was using Mercurial, so maybe that's why our opinion carried some weight.
We weren't the only ones, but we were one of the vocal ones.
I'm inclined to believe them compared to some random stranger who asserts that it should be easy for Mercurial to be ported to Python 3.
Unless you were saying that most other/non-Mercurial programs are easy to port to Python 3, which could be true.
I understand your opinion: It is the party line. But it doesn't actually help much when the process as described will take years and people only have months, and this is further worsened by the fact that PSF did not have to deprecate the entire Python 2 ecosystem in order to stop supporting CPython 2.7.
The writing was on the wall ten years ago. Failure to take action is not Python's fault.
PEP 461 was the bare minimum we needed before porting to Python 3 could happen:
http://legacy.python.org/dev/peps/pep-0461/
We needed a way to put things into bytestrings.
And after that, it's just nothing but work. Lots of it. Little of which could be automated.
I get a little impatient, personally, with people who think that upgrading software is easy. We don't actually care about Python. We care about version control. Python is just some thing in the middle that is helping us produce version control. A multi-year effort to upgrade to Python 3 (or 3.8 or whatever) isn't giving us or our users a net benefit. In fact, until recently, it was a net loss, because Python 3.5 or 3.6 had slower warmup time, which is terrible for a tool like hg that needs to pay that cost every time you run any command.
Instead, Python 3 created busy work. Almost five years of it.
I assume you're not getting paid for it, so besides bragging rights or a nice CV entry, what else is there for you to look towards?
Mercurial's greater modularity also has made it easier to implement improvements for monorepos, although personally that's less important to me.
That's why I still use and work on Mercurial.
Git is not horrible to use. And even before I was a proficient Git user, mercurial was giving a team of 5 people a lot of work trying to fix stuff that just works on Git.
Yes, I know that Python 2.x and 3.x handle bytes entirely different, yet I cannot understand how Python and their release planning should blindly "bend" to the demands of a project using the language.
I understand you don't care about Python the least, but we do? We have to? I think that the maintainers simply had to move forward at some point, there has been a way too long grace period.
And Python is not ANSI C. I think what you want of Python is to be never-ever-changing C89 and gcc still supporting it (I think it still does?)
More seriously, there's also quite a bit of Rust now.
The decision to make it not backward-compatible and thereby force-deprecate millions of lines of working Python code was extremely expensive.
My previous employer did most of the ATE, quality, and production control in Python; and hardware drivers mostly in C. It worked reliably for about 15 years. During late 2017, the new 'code boss' mandated Python 3 for new stuff, and to convert as required for existing stuff.
Production continued with little or no problems until an important customer did a major spec change, plus the new safety and EMC regulations and standards became effective, so we had to get some stuff re-certified and some processes accredited (again). After three months, the boss fired the three programmers and assigned the task to the quality, manufacturing and regulatory engineers. We looked at the code for a few days, then said nope and re-designed and wrote in C/C++. When I left in November, things were humming along well, but the parent company saw this as a huge future liability and commenced to shut down that part of the company that made that class of widgets. Think about - a group of less than 40 production people and a few engineers that pumped 25 million USD profit annually into the mother company was dropped because of potential future code shenanigans.
Because of these experiences, I discourage use Python professionally (unless the contract allows for some specific indemnity clauses) for quality and manufacturing, and know of other manufacturing and hardware activities abandoning Python for new stuff and 'returning' to C and C++. I continue to enjoy and use Python (mostly 3) for personal projects, where support and making money do not always matter.
Mercurial's curious implementation is also the reason I gave up trying to do anything with it. I love the idea of a popular DVCS written in a HLL, but it looked halfway to C.
It's not so bad. We just use a lot of abbreviations, but you get used to them.
There's also a reason for a lot of the ways it's written: backwards compatibility. We supported Python 2.4 until a couple of years ago. This meant you had to do "x and y or z" instead of "y if x else z" because the ternary operator wasn't available in older releases. This wasn't because we like old software, but because our users do. A data-storage solution needs to be stable over very long periods of time. You don't want to be unable to access your repo because you're on an old machine. A DVCS is too important to force your users to be chasing after the latest release all the time.
Another reason for Mercurial's style is to avoid unnecessary function lookups or calls and other quirks of the Python interpreter. Something as simple as
for x in y:
thing.doit(x)
can have a noticeable speedup if you instead do doit = thing.doit
for x in y:
doit(x)
because Python just takes a while doing function lookups. Our users notice those milliseconds of difference because they want "hg status" or "hg log" to be nearly instantaneous.These non-idiomatic uses might be shedding a few ms, yet they ruin the readability and maintainability of the code, most of all all tools like 2to3? Why not another (non-interpreted and thus faster) language? One where the idoms work in your favor?
Also, no need to support releases from 2004 and having to groan about it.
Either the major-version number should be changed (Python 31 to Python 32) or the project name should be changed (Python to Boa).
This is also a very common problem with GTK+ and some other major pieces of software.
1. https://github.com/tensorflow/tensorflow/issues/33374#event-...