52

The tag is pointless these days. The only supported versions of Python are Python 3.x, for many years now. Python 4 isn't happening ("probably there never will be a 4.0 and we'll just keep numbering until 3.33 at least" - GvR).

Tagging a question with both and does not convey any more information than just tagging it with .

Martijn's 2018 prediction that usage would just fade unfortunately did not happen, and it continues to see heavy daily use. Advice to "just edit the post to add the [python] tag" is not acceptable, as it treats the symptoms and not the problem, and necessitates ongoing janitorial work for new questions.

Is there a way on the platform to synonymize -> for new questions only? Apparently, only a moderator may create this synonym.

I think it would be a net positive to create the synonym at this stage.

(Outdated) previous discussions:

31
  • 16
    It looks like people are still occasionally asking about Python 2.x, so I don't think this is appropriate. Unless you think we should flip-flop and only require version tags for 2.x questions? That would probably be manageable
    – TylerH
    Commented Apr 22 at 18:52
  • 23
    @TylerH Asking about Python 2.x is fine. In that case you add python and python-2.x. What's the problem?
    – wim
    Commented Apr 22 at 18:53
  • 20
    We can't really expect two sets of rules based on a version number. If v2.x askers have to specify a version, why not version 3 askers? This is really something that we need tag hierarchies/parent tags for, honestly.
    – TylerH
    Commented Apr 22 at 18:54
  • 2
    And some people just go ahead and tag both versions.
    – Thom A
    Commented Apr 22 at 18:55
  • 20
    @TylerH For the reason stated in the first paragraph of this post. Python 3.x is just "Python", it does not add any useful context. Python 2.x does add useful context.
    – wim
    Commented Apr 22 at 18:57
  • 11
    @ThomA Well, FWIW, the only question w/ both that was asked this year is apparently wanting code that runs in both environments. But I think such questions are a good example of why version tags for both 2.x and 3.x are warranted. Just having one for 2.x would not indicate to readers that the question is about both versions, leading to a situation where people who are experts on interop/conversion between the two versions to potentially miss the question.
    – TylerH
    Commented Apr 22 at 19:06
  • 2
    Also, as I said a couple of years ago on this related question, there are numerous Python-related questions that don't have any Python tag. Eg, pandas, django, numpy
    – PM 2Ring
    Commented Apr 22 at 19:36
  • 23
    Wanting cross-compatible code is rare these days, but if you need that it must be mentioned in the prose - it can not be communicated using only tags due to poor signal/noise ratio here. This is not a convincing use-case for the continued existence of a [python-3.x] tag.
    – wim
    Commented Apr 22 at 19:52
  • 31
    "If v2.x askers have to specify a version, why not version 3 askers?" - Someone with subject matter expertise could not ask this sincerely, IMO. It's comparable to asking why [html5] is synonymized to [html] already. Commented Apr 22 at 21:56
  • 7
    There's no reason there couldn't eventually be a Python 4.x at some point in the future, this seems like it risks confusion (however unlikely), for little to no real benefit. IMO, if anything the unqualified python tag is the problematic one. Commented Apr 23 at 5:50
  • 7
    @Mr.Irrelevant In case you are suggesting reviewed edits, these are hardly "for free". It takes three people (one editor plus two reviewers) to make them. Please do not spam the review queue for such edits. Commented Apr 23 at 11:21
  • 6
    "Martijn's 2018 prediction that python-3.x usage would just fade unfortunately did not happen" - just like old close voting labels. If you expect people to adopt new labels by dropping the old ones, you don't know people. Persistent buggers.
    – Gimby
    Commented Apr 23 at 11:25
  • 3
    I mean, one of the better-known Python authors from the previous era (Mark Lutz) seems to think everything after 3.4 was a mistake, and Guido hung up his BDFL hat over the addition of the := operator in 3.8, yet 3.13 is under active development with no issues. Changes like removing the GIL and building new infrastructure for JIT bytecode optimization are not seen as reasons to bump the major version number. Meanwhile there is an established policy now whereby things can be deprecated and scheduled for removal after a certain number of minor versions. Commented Apr 23 at 18:30
  • 2
    @TylerH I think KarlKnechtel's analogy was fair. As one of the top users, from 500+ answers in [python-3.x] tag, I could count on one hand the number of times that the tag communicated anything useful that a [python] tag would not have done better. I expect most of these users may say similar
    – wim
    Commented Apr 23 at 18:30
  • 3
    Between that, and the newly established 1-year release cadence - at this point it can reasonably be argued that the 3 is a decoration with historical reasons behind it, and Python is effectively using calver rather than semver now. Commented Apr 23 at 18:31

3 Answers 3

40

I support this proposal wholeheartedly, as described - a simple synonymization, with no immediate or prior expectation of additional work.

In practical terms, Python 3 is as synonymous with Python as HTML 5 is with HTML; and there is no more reason to expect a future Python 4 on the horizon than an HTML 6. (There is much countering evidence, in fact: explicit statements of intent; the establishment of a 1-year release cadence with a deprecation policy that comes across like an attempt to disguise calendar versioning as semantic versioning; and the fact that major architectural changes have been made or are being made while keeping to 3.x version numbers.)

Python 2.7 has been past EOL for more than 4 years - which was already 5 years past the originally intended date, which in turn was announced before Python 2.7 even existed. Work on Python 3.0 started all the way back in 2006, before Stack Overflow existed.

Per tag guidance, it's already requested that questions with either a , or tag also have the generic tag applied. Despite that, less than half of new questions get a tag applied. This severely handicaps curators who are experts in Python perfectly capable of dupe-hammering Python 3.x questions (as they are essentially just "Python questions", and this has been the practical state of affairs for years) but who only have a gold badge and not for - itself a consequence of inappropriate tag fragmentation.

Here's a table of approximate new post frequency, to give a sense of how useless the version identification has become overall (and also highlight how much of a problem is caused by missing the main tag):

Tag combination Approximate rate of new questions in the last year Approximate fraction
also tagged as ,
as requested
without any version tag 300 per day (one per 5 minutes) N/A
40 per day less than half
Python 3 minor versions 2 per day less than half
1 per day about 2/3
Other Python 2 tags 2 per month almost all

In short: the tag fragmentation leads to a situation where a significant percentage of new Python questions are labeled in a way that makes them harder to curate. Meanwhile, the fact that the general tag technically covers Python 2.x, has basically become an irrelevant historical footnote.

Overwhelmingly, a "Python" question is simply a Python 3.x question now. On the already vanishingly rare occasions that someone does have a legitimate reason to ask a new question that is actually about code that must be Python 2.x compatible, where the compatibility requirement is also relevant to the question, it's almost always a question about some special environment (e.g. scripting for something like Gimp or Blender such that only Python 2.x is supported) that needs to be separately tagged anyway.

Historically, too, supposedly "2.x-specific" questions usually aren't really. "The question was tagged as 2.x specific when it really isn't, or because of some irrelevant detail" (e.g.: the question and/or answers use the print statement to demonstrate results, which doesn't work in 3.x but is completely irrelevant to the actual calculation that the question is about) is a far bigger problem than "the question should have been tagged as 2.x specific but wasn't because everyone involved was only thinking in 2.x terms". Even when everyone was only thinking in 2.x terms, it rarely produced a question where the 3.x answer would actually be different.

Python 2.7 is about as dead as it gets, and anything older is arguably better suited to retrocomputing.SE by now. There are many things we could be doing to improve Python question tagging, but "go through old questions to check if they're Python-2.x specific" is nowhere near top priority. Before that, we should definitely be worrying about the far greater problem of old questions that aren't version specific but give bad or obsolete advice due to popular misconceptions that sprouted in that era and refuse to die. (In particular, cargo-culting surrounding a) controlling the behaviour of Pip; b) the overstated importance of __init__.py files; c) misguided fear of relative imports generally; and d) absurd and inappropriate sys.path hacking.)


I also want to talk about version tags generally. They rarely work well in the first place, frankly. The problem is that people naturally want to use them to mean:

  • "I, as the person encountering the problem, am using this version, just in case that matters"

  • "The question is about a feature that was introduced in this version"

  • "The question should have answers about this version"

  • "The question could have answers about this version"

But the actually useful thing that the tag should mean is only and specifically: "The question concerns a problem that is particular to this version".

  • The OP's version rarely matters, and OP is almost never in a position to determine whether it matters.

  • A question about a new feature should be tagged according to the feature, not the version where it was introduced. So, (although maybe this should be ), not . (possible synonym: ), not . (although this doesn't exist; people use and sometimes instead - really not an ideal state of affairs), not .

  • Answers for particular versions are seldom useful because "adapting" the answer to a specific version usually just means changing some superficial framing details in the code, rather than actually taking a different approach to the problem. When it is useful (and this could be a quite superficial change - such as noting that some standard library function's name changed in a particular version), that is information that should be tagged in the answer. There is no good reason to restrict the question to answers for any particular set of versions - because of the general principle that the question exists for everyone, not just the OP. (If people want to write answers specific to long-obsolete versions unprompted, that can be dealt with the same way as any other roundabout, obscure or otherwise not-ordinarily-useful answer: by downvoting.)

Now, in theory, version tagging could help with identifying Q&A entries that have become obsolete. The problem is, most things don't become obsolete, and it takes subject matter expertise to know what does. Furthermore, it's utterly impossible to predict whether the thing I'm asking about in FooLang X will still be a problem in FooLang X+1 - whether the semantics will change for this specific feature; whether there will be a fundamentally new way of solving the problem that everyone's expected to use; whether my code example will break in a way unrelated to the actual question; etc. etc. etc.

If one squints hard enough, one can imaging tagging a question as version X (or X.Y) because it's about working around the lack of a feature introduced in X+1 (or X.(Y+1)). But personally I think this is still generally wrong, and such questions are still better framed as being about the feature itself.

7
  • 2
    Regarding the retrocomputing.se comment: that's obviously subjective, but the interested reader is invited to consider their standards for "retro" versus Python 2.6.0's release date along with the other relevant factors (like the fact that practically any environment where 2.6 could run should have no difficulty at least upgrading to 2.7, and the way that the 2.7 tag overtook other 2.x tags on Stack Overflow). Commented Apr 23 at 22:37
  • "one can imaging tagging a question as version X (or X.Y) because it's about working around the lack of a feature introduced in X+1 (or X.(Y+1))": you would still hypothetically and likely need an X+1 expert more than an X expert in order to backport the feature or come up with workarounds. And one rule of thumb for tags is "what kind of expertise does this question need?". Although I now realise this is beside your point. Commented Apr 24 at 20:32
  • Although in theory, retro-computing will consider questions on PC software perhaps only 20 years old, in practice, that's not their area of interest and competence, and you can expect the question to be closed after a couple of days without answer.
    – david
    Commented Apr 25 at 0:12
  • 2
    In addition, walrus notation is available in everything after 3.8, so the same question could exist with the python-3.8 tag and the python-3.9 tag
    – Mars
    Commented Apr 25 at 4:59
  • It sounds like the solution isn't to get rid of python-3.x tags though. It sounds like the best solution is to make python a wildcard that hits all versions of python. If it encompassed all python-*, it would nullify the effects of splintering from versions, while still allowing people to differentiate between versions when they want to.
    – Mars
    Commented Apr 26 at 1:26
  • @Mars I don't think the system infrastructure is in place to make something that work. FWIW, though, Codidact does support tag hierarchies. Commented Apr 26 at 1:41
  • Right, that is my understanding as well. I'm saying that the ideal solution requires creating that infrastructure, not just removing tags
    – Mars
    Commented Apr 26 at 2:22
9

While I agree that Python-3.x is just Python and should be its synonym, due to some bugs(?)/practicalities on the website, just synonymizing them could potentially make some questions with only the tag undiscoverable. This is related to an issue previously documented here.

The gist of the issue is that, at the moment, if two tags are synonymized, the search doesn't/cannot return an old question with the child tag.

Let's check this using this question as an example. You'll notice that it has the tag, which is a synonym of the tag. Now let's look for this question using the following search terms:

The first search returns our question, which demonstrates that using a tag in a search should work. However, the latter two searches return no results; in other words, neither the parent tag nor the child tag of synonymized tags is able to find this question. If this question had only the tag, it would simply be "lost".


What does it mean?

Well, it means if is synonymized with , questions with only the tag such as Python bytes concatenation will be impossible to find using its tag because it would not show up in a search. So unless this bug is fixed or questions that might get lost are re-tagged (these questions might be a place to start), we could potentially "lose" a lot of questions (or just make them undiscoverable) by synonymizing these tags.

Besides, Gold tag badges don't apply to synonymized tags suggests that you can't dupehammer questions tagged if you have the Python gold badge after synonymization either, so it really doesn't seem to be a useful exercise right now.

0
-1

This would be the best, but the manual work is extreme.

  1. Go through all existing questions and see if they are Python 2 questions or not. If they are, retag . Any question that could be either one (and there's probably a lot) gets no change.

  2. Merge into .

I don't know enough Python to help with 1.

If you think it's too much work, post a competing answer. We don't have any answers yet. ("Leave it" is a competing answer.)

10
  • 7
    Does 1 really need to be done? After all Python 2 is still Python. The Python 3 tag could just be merged into the Python one especially that the Python 2 tag description says "For questions about Python programming that are specific to version 2.x of the language. Use the more generic [python] tag for all Python questions, and only add this tag if your question is version-specific." Commented Apr 23 at 17:25
  • 1
    @IslamHassan: Essentially what one is doing is checking for Python 2 specific questions that are tagged with just Python because they were made a long time ago.
    – Joshua
    Commented Apr 23 at 17:27
  • 1
    I'm not a Python developer and rarely use it but I understand that Python 3 came out in late 2008 and a quick investigation reveals that there are questions from 2008 tagged as Python 2, questions from 2009 tagged as Python 3 and tons of questions that are only tagged with Python. I don't think the manual work is needed for the merging to be done. Commented Apr 23 at 17:35
  • 1
    @IslamHassan The transition from Python 2 to 3 was very long. The Python 2 End of Life was postponed until 1 Jan 2020. There are a lot of Python 2 questions with just the plain [python] tag. Plenty of those "vanilla" questions and answers do apply to both versions, but there are some changes that affect efficiency (using lists vs generators), and a major overhaul in Unicode handling.
    – PM 2Ring
    Commented Apr 23 at 18:10
  • 4
    I'm against 1. Let sleeping dogs lie.
    – wim
    Commented Apr 23 at 18:13
  • (cont) Some old Python 2 code can easily be modified to work correctly and efficiently on Py 3, but not always. And some of us made an effort to write code that functioned correctly (if not necessarily at highest efficiency) on both versions. So some of that old Py 2 code is still useful, but some of it's obsolete rubbish. And it can take time and expertise to tell the difference...
    – PM 2Ring
    Commented Apr 23 at 18:13
  • 2
    @wim: That's fine. Write an answer and let's see who votes on it.
    – Joshua
    Commented Apr 23 at 18:16
  • @PM2Ring I am aware of the painful transition due to the lack of backwards compatibility and that Python 2 was supported until 2020. However, as it currently stands it looks like the merging won't make the situation of the Python 2 questions untagged with the Python 2 tag worse. I maybe mistaken of course. You, as a subject matter expert, can assess the situation better. Commented Apr 23 at 18:17
  • If questions have two tags and one is merged into the other, does the system handle that gracefully? Because there would be a lot of such questions in this case. Commented Apr 23 at 19:24
  • @KarlKnechtel: If it doesn't, that's bot cleanup worthy.
    – Joshua
    Commented Apr 23 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .