32

These tags all relate to :

However, as seen by this query, there are almost 200,000 questions which have at least one of these tags, and do not have the tag.

Is it possible to add the tag to all of these questions, as they may not reach answerers (like me) who just watch , and none of the others.

31
  • 4
    What about questions that already have 5 tags, how would that be handled? If you simply want to find these questions easily, you could try using [python-*] as your search (though I believe wildcard are limited to the number of tags they can return).
    – Thom A
    Commented Aug 29, 2022 at 11:28
  • 31
    IMO the version specific tags should simply be nixed, this is chaos. Trying to automatically add tags is automated chaos. If it is so important that a version needs to be indicated, the site should have a dedicated feature for it.
    – Gimby
    Commented Aug 29, 2022 at 11:44
  • 7
    IMO this goes beyond what the tag system currently supports. python-3.x should not need python in addition, it should be python plus something extra. Having either or both separate tags is just a workaround, and as such there is no ideal solution. Commented Aug 29, 2022 at 12:00
  • 7
    If the proposed versions tags system ever came in, then this likely wouldn't even be a problem.
    – Thom A
    Commented Aug 29, 2022 at 14:06
  • 2
    You can create custom filters to watch multiple tags. This way you can watch for all the Python* tags you like and see the results in a single view. Commented Aug 29, 2022 at 14:16
  • 18
    I'm no python SME, but I know that the difference between v2 and v3 is significant and included breaking changes to the syntax. I feel like that alone provides enough use case for having the 2.x and 3.x tags respectively. That said, every single minor version having their own tag is something that I've seen as excessive for a long time... There's no way that each minor version includes enough changes, nor generates enough version specific questions, to need its own tag.
    – zcoop98
    Commented Aug 29, 2022 at 15:36
  • 10
    @zcoop98 - I agree. If the question is very version-specific, just include it in the body (or even the title) - there is no need for a separate tag. There's no way someone is specialising in the tag [python-3.5] any more than they specialise in [python-3.x]. I say we scrap all the version tags except 2.x and 3.x.
    – The Thonnu
    Commented Aug 29, 2022 at 15:57
  • 3
    Ideally, yes, they should all have the python tag. However, it would take a CM or developer to add the tag to all such questions in a quick way that does not disrupt the front page with 500,000 edits. So it is unlikely to be done.
    – TylerH
    Commented Aug 29, 2022 at 18:52
  • 3
    Also, there are numerous Python-related questions that don't have any Python tag. Eg, Pandas 20,027, Django 135,187, Numpy 6,680.
    – PM 2Ring
    Commented Aug 30, 2022 at 7:27
  • 5
    @Gimby Yes, it's a horrible chaotic mess. We do need to strongly distinguish between Python 2 & 3 (there are several huge differences), but I don't think that minor versions need to be distinguished at the tag level.
    – PM 2Ring
    Commented Aug 30, 2022 at 7:35
  • 4
    "Every Linux distro comes with 3 by default" cries in RHEL 7 Commented Aug 30, 2022 at 10:33
  • 3
    @Braiam Sure, someone writing new Python code is most probably using Python 3. But if they use old Python code from SO they need to know whether it's Py 2 or 3, so we still need separate 2.x & 3.x tags. Sometimes you can tell whether code is Py 2 or 3 from the syntax, but not always. Sometimes old Py 2 code works ok on Py 3, but sometimes it behaves differently. If you're lucky, it will simply fail with an error message, if you're unlucky it will silently give you incorrect results. A Python expert will (probably) be able to figure it out, but it can be very confusing to a newbie.
    – PM 2Ring
    Commented Aug 30, 2022 at 11:09
  • 4
    We could probably to without any of them, except python-2.x for legacy questions (Python-2 users will have upgraded to 2.7 by now, which won't be updated any higher). Any other Python version can just mention the version within the question body if it's relevant. Python-1 doesn't even have a tag, and most users running Python-3 will be (more or less) up to date, making a bare python the logical choice (which it is anyway for questions where the specific version doesn't matter too much).
    – Adriaan
    Commented Aug 30, 2022 at 11:38
  • 2
    @Braiam I never suggested that we need a new tag! I fully agree that we need fewer Python tags. But we do need to retain separate tags for Py 2 & 3, otherwise readers could get confused by old Py 2 answers. Remember, the vast majority of people using the site find stuff on SO using external search engines, they aren't posting questions or answers.
    – PM 2Ring
    Commented Aug 30, 2022 at 20:37
  • 2
    @Greedo - thanks for noticing that. I'm not going to add all of them up, but the main two are: over 125,000 python-3.x not python, and over 30,000 python-2.7 not python and that's still a lot
    – The Thonnu
    Commented Aug 31, 2022 at 12:52

2 Answers 2

37

Yes, these questions should all have the tag.

Version-specific tags should never be the only tag on a question. Whenever a version-specific tag is used, it should always be combined with the non-version-specific tag for that language/framework/tool. If you notice an individual question (or a small number of questions) that fails to do this, you should submit an edit to that question that fixes the tagging.

At this point, where the tag would need to be added en masse, it's far beyond something that anyone would want to do manually. And even if someone were willing to take their time to do it, I wouldn't want them to do it, because making this number of edits to old questions would be extremely disruptive. (All edits "bump" posts. Even moderators have no way of making non-bumping edits. Staff can make non-bumping edits, though. Shog9, when he was a CM, used to have just such a tool. It's unclear to me if current CMs are willing or able to run this tool, or if they have anything equivalent. But…read on.)

There is another aspect to consider, which was pointed out in the comments: some of these questions might already be at their limit of 5 tags. That is a hard limit, so in order to add the tag, at least one of the existing tags would need to be removed, so that it could be effectively replaced with . That can't be done by a machine, even if we had access to an automated tool that could retag questions.

Given these realities, and the fact that version-specific tags are a necessary evil that are quite rarely needed in practice, I think the best solution here is to merge some (all?) of the version-specific tags that you listed into the main tag. Merging a tag into another tag is something moderators can do with a single click. It has the effect of changing all instances of that tag to the tag it is merged into, so all questions currently tagged would, for example, become tagged . These are non-bumping edits, with no entries in the revision history. If the question already has the tag, no change is made other than the removal of . If the question is not already tagged , then the merging of into would cause the question to become tagged with , and in such a way that avoids reaching the 5-tag maximum.

The only issue is, I have no Python subject-matter expertise whatsoever, so I don't feel comfortable making the decision about which version-specific tags are useful and which are not. We'll either need a consensus of Python users to post here, or we'll need one of the moderators who are Python experts to make this happen.

Either way, thanks for bringing this to our attention. I personally think this is a more important problem to address than most of the "burnination" requests that we receive.

Related: Choosing Qt tags

22
  • 9
    IMO: the minor-version tags are only useful when asking about features that were introduced in that new version. They could be added retroactively if it is determined that the behaviour observed by OP is version-dependent. On new questions, the 3.x tag is never useful, because 3.x is the norm now and 2.x is the rare exception that needs to be marked. Commented Aug 30, 2022 at 4:38
  • 3
    Agreed, @Karl. [python-3.x] should probably be merged into [python] as it stands now, since that's the norm. I'm not convinced that minor-version tags need to be used for features introduced in that version. Wouldn't it be better to use a tag that describes the feature itself, rather than the version number? As you said, the version-specific tags really should only be used when the topic of the question is version-dependent. To me, that means, say, a bug that exists in Python 3.6 but was fixed in Python 3.7.
    – Cody Gray Mod
    Commented Aug 30, 2022 at 5:05
  • 3
    Quite possibly. I can imagine exceptions, but I doubt they'd be common enough to make the minor-version tags all that worthwhile. The trickle of new questions tagged 2.7 has slowed to a few per day, and most of those are either awful, have all three python/2.7/3.x tags, or both. I was actually separately wondering whether there are any good reasons, even historically, to use both 2.x and 3.x tags. It seems to appear on some questions about migration, but the tag descriptions seem confused about how those cases should be handled. Commented Aug 30, 2022 at 5:07
  • 10
    Also IMO, it's fine if we have tags like python-fstring and OP doesn't know to use them; others can retag the question. A question that was asked about f-strings when they were introduced in 3.6 is probably better tagged python-fstring than python-3.6; and a new question asking "why can't I use <this code using fstrings> <in what turns out to be 3.5 on an older computer>?" is much better tagged python-fstring than either python-3.6 or python-3.5. Commented Aug 30, 2022 at 5:10
  • 1
    I think there is some value in keeping a 2.x tag (a merge of the current 2.*); Python 2 is likely to linger for a while in embedded or otherwise hard to upgrade systems for a while, so visitors may still be looking for Python 2 answers. It would also act as a signal to avoid editing answers to use Python 3 syntax. Questions tagged with version-specific tags due to a version-specific bug are quite rare I suspect - I don't recall ever seeing one - so I wouldn't object to 3.x being merged into Python; many bugs are fixed in point releases anyway Commented Aug 30, 2022 at 6:58
  • 1
    meta.stackoverflow.com/users/100297/martijn-pieters is a Python expert.
    – PM 2Ring
    Commented Aug 30, 2022 at 7:14
  • 12
    If we are going to keep the 3.X and 2.X tags, then it might be worth to alias the 3.1, 3.2, 3.3, ... to 3.x and likewise for the versions that correspond to 2.X. I'm ambivalent about aliasing python-3.X to just python, since it would mean erasing the distinction between "any python" and "3.X python". Perhaps it should be the other way around – that python is an alias for "the most recent version" aka 3.X currently but perhaps something else in the future. Commented Aug 30, 2022 at 7:30
  • 1
    "fact that version-specific tags are a necessary evil that are quite rarely needed in practice" I would challenge that with data. Most questions that change between versions of the language includes a solution for each version, sometimes by the same user. And coming from both AU and UL that had version specific tags for entire OS, they are less relevant there such that either they become dominant tags just to mean "I'm using this" to simply remove them since their usage is essentially pointless.
    – Braiam
    Commented Aug 30, 2022 at 10:37
  • 4
    Did you just introduce me to Martijn, @PM2Ring? I have, in fact, heard of him. :-)
    – Cody Gray Mod
    Commented Aug 30, 2022 at 11:00
  • 1
    I was just responding to we'll need one of the moderators who are Python experts to make this happen. I would've been very surprised if you hadn't heard of Martijn.
    – PM 2Ring
    Commented Aug 30, 2022 at 11:12
  • 2
    I still have a bulk retag tool I could dig up, which I could run for all questions with less than 5 tags at a low rate (e.g. 1 question per 5 minutes) to minimize disruption, if a mod wants that.
    – Erik A
    Commented Aug 30, 2022 at 11:31
  • 1
    @snakecharmerb it's fine if there are still new 2.x questions that demand specific 2.x answers, and certainly we should avoid changing code to 3.x syntax in those. So certainly we cannot get rid of the tag yet. However, for old canonicals on generic Python topics that were asked and answered using 2.x syntax back in 2012 or whatever, we absolutely should edit to update to 3.x syntax because almost everyone who finds these questions today is going to need or want 3.x syntax. Commented Aug 31, 2022 at 0:11
  • 1
    @Braiam the situation I am imagining is an OP that tags 3.5 because "oh there's a 3.5 tag available, I should provide as much useful information as possible". In most cases, it won't be relevant; in the few where it is, it would be better to use a tag that is specific to why it's relevant this time. Commented Aug 31, 2022 at 0:13
  • 2
    Perhaps a continuous script could run on a "community/mod" account to automatically retag new questions? Commented Aug 31, 2022 at 4:58
  • 1
    @MateenUlhaq I think it makes much more sense to handle that kind of problem by synonymizing the tags, as in MisterMiyagi's proposal. Commented Aug 31, 2022 at 10:09
17

TLDR: Let's squash minor versions and equate to "the current version".

As Cody Gray suggests in another answer, moderators turning tags into aliases is a viable way to do this.


From my experience on the Python tag, minor version tags such as are almost never useful. Most prominently:

  • To describe features, these tags fail to cover other versions in which the feature works the same. For example, the top Q&A on for the then-new @ operator, async/await keywords, and type hinting are still relevant for the most recent versions.
  • To describe dependencies, these tags fail to provide accurate information. Bugs in Python implementations usually affect multiple minor versions but at different patch version; the platform and even 32-bit vs 64-bit builds are often needed as well. That is assuming the interpreter is actually relevant in the first place, which many askers cannot tell.

=> The resolution of Python tag versions should be reduced. All major.minor tags should be aliased to the respective major tag.


As someone developing new software with Python but also keeping production systems running, I must say the distinction between Python 2 and Python 3 is still relevant – in fact, it is more relevant today seeing how the two diverged by 10+ years. Not just differences in the language itself, but changes in the technology of implementations and the ecosystem affect how to approach tasks.

In contrast to minor versions, Python 2 users know that they are dealing with a special version. Answerers tracking this tag know that they are dealing with a special version. The tag is not something used on a whim.

=> The Python 2 tag should be kept to distinguish this "legacy" version. Python 2 should not be aliased into broader tags.


Now, what about Python 3 and plain Python? In an ideal world "Python" could mean "any Python" whereas "Python 3" is a specific version – but that is not how it would work in practice, as far as I can tell. We just have too many people that do not care about the distinction. Ultimately, the two must mean the same one way or another.

Since I am proposing to keep as a "real" tag, I am slightly in favour of keeping "real" as well and making an alias to it. That way, python-M.X means a specific major version and python just means "the current version" – as unlikely as the latter is to change in the foreseeable future.

=> The Python tag should just select the "default" version. Python should be aliased to the Python 3 tag.

10
  • 4
    How about calling it python-2 in that case, give it's for all minor versions anyway? With the same for python-3 of course, aliased to python itself (to be revisited whenever Python 4 releases)
    – Adriaan
    Commented Aug 30, 2022 at 12:01
  • 5
    I'd add someone watching one of the major tags is unlikely to care what the minor version is in most cases. It would probably be best to keep the .x at the end of tag so as to emphasize the "real" tags could refer to a specific version, and expect the question or answer to include which minor version it pertains to.
    – 0x263A
    Commented Aug 30, 2022 at 12:44
  • 3
    The first example that comes to mind of a version specific tag being mildly useful is Are dictionaries ordered in Python 3.6+?. But even in this gotcha it would be just as useful to have a python-3.x flag and mention the specific version in the question/answer
    – 0x263A
    Commented Aug 30, 2022 at 12:45
  • 7
    @0x263A I think dictionary order is a good example against minor version tags. It is specified in Python 3.7, but implemented in CPython 3.6 and PyPy-since-ancient-times. Restricting the question to just one specific version seems to be a waste. Commented Aug 30, 2022 at 12:56
  • @MisterMiyagi I agree with that sentiment.
    – 0x263A
    Commented Aug 30, 2022 at 13:04
  • Wouldn't the answer to that question @0x263A be "depends on the version of python that you are using"? A good answer should describe which version are they ordered and how. (BTW. I rarely care the cardinal order in my dicts, I just select the key(s) I need the value(s) of and presume they are randomly ordered each time I access them)
    – Braiam
    Commented Aug 30, 2022 at 19:23
  • Oh, hey, apparently I'm doing it right "The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon".
    – Braiam
    Commented Aug 30, 2022 at 19:25
  • 4
    @Braiam Yes, also you missed the next bit of the answer "As of Python 3.7, this is a guaranteed language feature, not merely an implementation detail"
    – 0x263A
    Commented Aug 30, 2022 at 19:44
  • Python pre 3.6: Dictionariy keys random order, Python post 3.7 Dictionary keys guranteed to be insert Ordered. between 3.6 and 3.7 it depends - some will deliver insert order but it was not guaranteed by the language. So some 3.x in some questions may make sense. So you may need to be a sme to decide which 3.x to merge into what 3.x and it may depend on the question itself if such a merge would be sensible. Commented Aug 31, 2022 at 10:46
  • @0x263A But I want my code to work on any version of python 3, so it's still an implementation detail.
    – Braiam
    Commented Aug 31, 2022 at 13:36

You must log in to answer this question.

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