Python is an open source project I've used and contributed nothing to, so I don't have the right to be a back seat driver. Were it a commercial project and I was a customer, I would be quite upset.
Were I a commercial customer, and had been told to switch to the new version ten years ago, then it's on me if I still have started the migration yet.
https://github.com/getsentry/sentry/issues/8806#issuecomment...
https://github.com/getsentry/sentry/issues/1152#issuecomment...
I mean, even supervisord is migrated at this point, and it was a long-time laggard.
Actually, I can't wait to remove it from my hard drive on Jan 1, since it's one of the most poorly designed apps I've ever used. It's really not surprising at all that they're not able to migrate it, assuming the quality of the app is indicative of the quality of the code. I wouldn't be surprised if the same was true of a lot of applications that are refusing to migrate. (I'll probably have to find an alternative to ebook-convert, the command line tool that's the only part of Calibre I use, or maybe I'll rewrite it in Python 3 myself.)
The gui, Calibre proper, is a total nightmare. Functional, but my god is it esoteric and ugly. I've heard people actually use that gui as their primary ebook reading software and I just can't fathom how they find that tolerable.
https://manual.calibre-ebook.com/generated/en/ebook-convert....
> No, it doesn't [need to convert to Python 3]. I am perfectly capable of maintaining python 2 myself. Far less work than migrating the entire calibre codebase.
That's a very strange quote. I want to have this much self-confidence.
You can write code that's compatible with both Python 2 and 3, but I don't think you can expect to be using Python 2 exclusively and write code that works well in Python 3 unless you're constantly running it with Python 3. Especially, if you don't have much firsthand Python 3 experience. This is much easier if your code is isolated from those dependencies and you write tests that run in both Python 2 and 3, but that's quite a bit more of a commitment than you seem to be implying.
I get your point though about not being able to run full integration tests due to dependencies. Still, if you were making a good effort to keep the code Python 3 compliant, it would make upgrading much easier.
Also, my other suggestion- contributing to Python 3 compatibility for modules you depend on! That will give you Python 3 experience :)
It's still hard to get bilingual Python correct today, and it was considerably harder before 3.3.
import subprocess
import re
import yaml
output = subprocess.check_output(['ls', '-l'], universal_newlines=True)
matching_lines = []
for line in output.splitlines():
if re.search(r'total', line):
matching_lines.append(line)
with open('matching_lines.yaml', 'w') as f:
f.write(yaml.dump(matching_lines))
Python 3.7: https://repl.it/repls/PotableDamagedAutocadPython 2.7: https://repl.it/repls/OrchidDirtyNotification
The much worse case of this that I dealt with a few years ago was reading in and modifying XML files, and then saving the modified XML contents as strings in a yaml file (a keyed cache). The input XML files (which I didn't control) were not consistent about having the encoding marked, and that really made things a mess for ElementTree.
A taste: https://github.com/ros-infrastructure/rosdistro/search?q=utf...
I know that's not the version of Python you were targeting, and I know you didn't write this program to be cross-platform, but I wrote a similar program and I was repeatedly surprised by those sorts of problems. I don't entirely agree with mikepurvis, but I do feel his pain.
This is simply untrue— there are a dozen small stumbling blocks that mean that writing bilingual code has a real cost. And it's not as easy as just having the right CI setup, especially if it's ten years ago and most of your dependencies haven't migrated.
Q: Ten years ago how would you have explained to your manager that you needed your team to start writing 2-3 compatible code, which obviously takes considerably more time and effort than sticking with 2 compatible code?
At this point, all the code I write is 2/3 compatible, and the things that annoy me are all py3 only features. Backwards compatibility stuff is pretty easy. Most of the easy problems are easy, and six has solved all the hard ones for like 7 years.
And I've been writing some of my code 2/3 compatible since 3.4.
This sounds a bit like telling someone, oh, you could've easily started driving an EV, so that once charging stations were actually out there, you'd have been ready...
While car analogies are notoriously bad, it's much more like "I'm going to buy a plug-in hybrid and use gasoline until charging stations are widely available". You can write code that works in Python 2 that takes zero effort to run in Python 3. I (and many others) have been doing this for years. Just look at the number of packages on PyPI that run, unmodified, on 2 and 3.
[Edit: gas -> gasoline]
- 2008-2012 Python 3 becoming usable (byte formatting, six library)
- 2012-2016 Libraries (Django, etc) becoming compatible
- 2016-today Applications (Trac, Ansible, Chrome[1], etc) becoming compatible.
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=942720
If the deadline wasn't 2020 but 2024, then you wouldn't get more time, simply we'd be at "not yet ready to migrate" state right now, as major libraries would not have switched yet.
I had to manage a mature codebase upgrading Ruby versions, and it was painful. And that is fairly mild by comparison; not the big jump from Python 2 to 3.
A lot of devs like to not worry about new things.
Library, as is most open source libraries out there, sure.
For a big company-internal Python codebase that also has to wait for all the major libraries to migrate first, that time frame can quickly shrink to 1-2 years, which is very little.
Beggars can't be choosers; if your company wants or needs major libraries to have migrated 4-5 years before the deadline, then your company has to participate in making that migration happen. Or accept that it's going to be done later than you'd like, because the needs and motivation of these library maintainers are quite different from the motivation of Python core maintainers.
“The free libraries we chose to depend upon haven’t migrated.”
Do you have programmers?
“Of course.”
Put them to work.
“We have other priorities.”
Well then. Your choice, your outcome.
Sure, they will have to cope. One of the ways people cope is by accepting security risks and continuing to run with old versions. Another is to decide that Python isn't for them, and move resources toward better platforms with commercial support for older code.
The fact is, that until a few years ago there were too many libraries that were not compatible for most organizations to make the switch. So, effectively the window for those organizations has only been a few years.
I think he's blaming organizations, not engineers.
I also think organizational dysfunction is a problem that isn't a technical problem that the Python project has the capability or duty to solve.
No one is doing that.
OTOH, it's not PSFs job to protect developers from bad management.
If there wind up being major security issues, there will be little choice but for someone to take up the mantle and fix them. Because companies aren't going to switch, and when you've got a botnet ravaging the internet they can't flip a switch and do a big-bang rewrite, someone will have to push out a patch for them.
This isn't the end of Python 2, it's just the Python team washing their hands of it. Ask PHP or Cobol users how their attempts to kill legacy codebases worked out for them.
This whole endeavor was complete folly from the Python foundation to begin with. A big-bang rewrite because they didn't like the syntax, and they didn't even fix the GIL while they were at it.
I'm supposed to go and tell all the various projects that I depend on that they have to change their upgrade timescales to suit mine? Even if I had enough time to help them all meet that kind of timescale, why would they agree to fit their changes into my required deadline?
Maintainers are under a lot of pressure. Having users come along and say "we'll add 50 developers to your project if you agree to ship v3 compliance by next month" is not reducing that pressure, it's adding to it.
More programmers != better results or faster delivery. Your solution is just going to create more problems.
At no point do you have to wait on anyone else, you choose to.
The Python 2->3 window is an example of where being too nice to too many users harms the project. Once Python 2 is dead, people will choose between being the sole maintainer of a Python 3 fork of some Python 2 library versus a being a sole maintainer of their entire Python 2 stack from the language layer on up.
Still better than my last programming job where the vendor of a vital piece of HW had provided a C++ API (also vital), but refused to provide dlls that would work in anything newer than VS2010. At least with open source you can do something about it.
Programmers ~= Resources ~= Money
=> If you want your dependencies to be upgraded in a reasonable time frame, try to contribute to financing the maintainers (or support them in a manner _they_ find suitable).
Personally, I would guess that many organizations will be running in Python 2 for at least parts of their codebase come 2020.
Is it though? Especially since as late as 2014, everyone was under the assumption that in 2015 security support would end. We were already trying to migrate long before that. The five year extension seems pretty reasonable to me.
Actually, depending on what action you pin dates to, it was twice as long.
One other thing - you can’t run non-64 bit apps anymore. You can still run Python 2.
I feel like this the python community has been the epitome of class regarding communication during a transition.
There are an increasing number of applications which require .Net 4.7, we found one early this year.
Promising "10 years of support" for a product is great, but if/when other vendors decide to undercut this, you can still be SoL :(
Where they only release security updates and no breaking changes?
At the company I work at, we've got a large amount of Fortran code from the '70s that works fine with the latest and greatest Fortran compilers (barring deprecation warnings which help guide refactoring efforts). Same with C/C++ from the '80s.
There is also the case of Oracle, which defines support as "you can read our knowledge base and we will answer a phone before telling you it can't be done", meaning their support is literally for life (of the company). And they still manage to screw it up by deleting old KM articles...
Everything else in IT goes towards shorter and shorter support windows, because the field is always in flux and change (or rather churn) accelerates every year.
Food for thought, anyway.
Mind that there is a feedback loop between data of current usage and an eol announcement.
If they announce an EOL close by this creates pressure to migrate.
You can still get Microsoft Windows XP support today. If you're prepared to pay enough.
I wonder how many of the people who're upset by this have ever or ever worked for companies that've ever sent anything more than pocket change to the people Python?
"For me" highlights the fact that my preferences, character, skills, etc., are different from other people's. Something might work well for me but badly for someone else because I happen to be good at working around its quirks, or bad at noticing its faults, or just not interested in the things it doesn't do.
"For my use case" highlights the fact that the things I need to do are different from other people's. Something might be good for my use case but bad for others' because I don't need very high performance but they do, or because I need the gostak to be able to distim the doshes backwards but they don't.
If I move on to doing different work and someone else takes my place, I expect something that works well "for me" to continue being useful for me but not for them, and something that works well "for my use case" to be useful for them but not for me.
"Use case" comes from 90s software engineering: https://en.wikipedia.org/wiki/Use_case
Corporate-speak and cliché idioms makes one sound less clever, not more. It might temporarily signal belonging to some crowd (for example, the HN tech crowd), but in the long term it hampers one's ability to communicate in an effective and elegant way.
I can think of countless annoying corporate buzzwords I see all the time on HN or at my job which are totally opaque and useless. "Use case" is two simple English words which anyone, including non-tech people, uses and clearly understands. This is not the hill to die on. I could link so many comments posted in the last week which are infinitely more buzzword-laden and irritating. If you really feel the dire necessity to chastise them, at least pick one of of those.
I do partly agree with you on "moving forward" or "going forward". I'm skeptical the situation was nearly as ambiguous as you suggest (it means "in the future", which is ambiguous, but it's no more ambiguous than saying "in the future", and anyone can easily request clarification if they hear "in the future"), but I had a few managers who said and wrote that like 30 times per day, and it does start to get on your nerves. Perhaps "use case" is similarly overused by some, but it also has a specific and clear meaning which would take longer to say/write than just using the term.
Source?
Where I am "use case" is definitely [still] tech jargon. I know very very few non-tech people who've ever heard it used, much less could give a definition for it.
Notice that you are already in contradiction with the first criticism that I received in this thread, where a subtle difference in meaning was proposed.
> it means "in the future", which is ambiguous, but it's no more ambiguous than saying "in the future",
The main point is that it is totally unnecessary, we already have the future tense to talk about what will happen in the future.
The same applies here. Remove the phrase with "use case" and you get exactly the same meaning, with less words and less cringe.
"My use case" just generalizes "my {project, job, task, case}(s)". It's not ambiguous, because the intention is to be general. "For me" is a bit more general than that, though, and sometimes you want to be a little more specific.
The specificity hierarchy / subtle difference in meaning goes from "for me" (my attributes) -> "my use case" (my attributes + the case's attributes) -> "my [job/project/whatever]" -> "my [exact thing I'm specifically doing]". I think all can be valid, depending on the context. I maybe should've said "'case' or 'situation' for a particular project or task or goal done by a particular person (or group or organization)" instead (I was implying the latter part), but there's no contradiction here. By contrast, "moving forward" is typically implied and unnecessary no matter the context and can usually be cut as dead weight.
But if if this is a hard-stop item for you at this juncture, then we should circle back... I'm sure we can align on this going forward. ;)
I think you feel that way because of the HN/tech echo chamber. Nobody says or feels the need to say "use case" outside of such circles.
> But if if this is a hard-stop item for you at this juncture, then we should circle back... I'm sure we can align on this going forward. ;)
Hehe ;)
Regardless, I would argue that "use case" has a quite specific and useful meaning that goes beyond mere corp-speak. I wouldn't use in conversation at a neighbourhood barbecue, but in a technical context (like a discussion of Python) the usage seems perfectly fine.
You seem to have reversed cause and effect here. New words/phrases/jargon comes into common usage when it is useful for communicating something. The difference might be subtle, but people wouldn't use the word if they didn't think that it was an important distinction to make.
I think the grandparent's usage of "use case" was totally fine. It wasn't distracting and it didn't change my reading of that comment in any way, shape, or form.
I disagree. HN is a place that seems to pride itself on the quality of its discussions, and on a higher intellectual caliber when compared to other Internet discussion venues. Surely a good command of language is part of that?
Beyond that, who are we to judge what constitutes "good command of language?" Which language are we even talking about here? I don't think HN is going to become a better place by becoming more elitist.
> I don't think HN is going to become a better place by becoming more elitist.
err...
EDIT: I think it's clear nothing more needs to be said. Feel free to respond to this comment or not. I've said my piece.
In this case, you could have said nothing.
"This particular individual" -> "this person"
* ducks and runs
You could work on porting them or be part of that effort?
In 2019, I feel pretty confident about using Python 3, having used it exclusively for about 18 months now.
For my personal use case at least, this timeline worked out well for me. Hopefully it works out for most everyone. I can't imagine they made this decision without at least some data backing it up.