3

One of the most popular languages that people code with on their Pi's is Python.

Most people who are using Python I imagine are using version 3. Since its the most up-to-date version of the language currently.

Now, whilst the site is not focused towards coding in general, many questions are about coding and are Pi specific. An example of this is the GPIO library.

The syntax between version 2 and 3 of Python are somewhat similar. But there are certain things that are only possible in Python 2 as some libraries are only available on version 2 without porting them across.

I'll admit version 2 is legacy at this point, but what I'm wondering is if there is a need to more specifically tag which version of the language was used?

  • 1
    Please note that - if this proposal gets through - you will need to fix 1,595 questions to get the tags right ;) – Ghanima May 25 '17 at 16:47
  • 1
    I was thinking of just having say a Python 3 and Python 2 tag as well as the Python tag. These tags could be used for something specifically Python 2 or 3 related. – Darth Vader May 25 '17 at 16:51
4

It's fair to say that plenty of beginners fail to spell out which version of Python they are using when posting questions. Separate tags might mitigate this issue to some degree - if the OP uses them right or other users copy edit the post to that end.

Given that Python 2.7 support will phase out in 2020 I wonder if introducing separate tags is little more than rearranging the deck chairs on the Titanic.


On a side note. Congrats on your current rep, isn't that the serial number of the Stardestroyer Enterprise ;-)

enter image description here

  • I used Python as my main example, I'm sure the idea of version specific tags could apply to different languages as well. – Darth Vader May 25 '17 at 17:07
  • 1
    TBH I have no strong objection about it. You've got the rep, feel free to introduce new tags where appropriate. If the community decides to not like them these can be taken back to meta and discussed on a case-by-case basis. Otherwise, just give it a try. – Ghanima May 25 '17 at 17:31
  • @DarthVader, I have to admit I somewhat dislike the tag being python-v2 I'd rather go for python-2.7 or python-2.x (SO has python-2.7 and python-3.x). – Ghanima May 25 '17 at 17:47
  • Feel free to edit it, I'm open to suggestions. – Darth Vader May 25 '17 at 17:48
  • Well, actually SO has 2.7, 2.x, 3.x, 3.4, and 3.6 and more. So my I wonder now if we're fine with 2.x and 3.x or whether we need it more specific. – Ghanima May 25 '17 at 17:49
  • I think just 2.x and 3.x. I don't think there is a need for anything more specific than that. If the question warrants that level of detail about the language, it is more than likely that it might be better placed on SO. But as the site continues to grow having programming based questions categorized by specific language version could be useful. The issue with having super specific tags is they are only usable if someone bothers to include the detail in their question. – Darth Vader May 25 '17 at 18:36
3

The syntax between version 2 and 3 of Python are somewhat similar. But there are certain things that are only possible in Python 2 as some libraries are only available on version 2 without porting them across.

I'm not a python user, but I have observed the fact that these two versions have existed in parallel for some time now, obviously one slowly supplanting the other.

Realistically, python is the only language tag here on which this is worth bothering. C++ has undergone a lot of evolution in the last decade, earning it a range of tags on Stack Overflow, and likewise Java versions include nuaces and depreciations, such that it has version specific tags there. These are unlike python in that they try to maintain a very high degree of backward compatibility. Perl, however, is the same in that perl 6 is not backward compatible with 5 or 4 etc. I imagine every language has one distinction or the other with major versions, and there may even be significant differences in the API with minor versions (there are corresponding examples of minor version tagging on S.O., e.g. lua-5.x). But I do not think it is worthwhile for us here to have multiple perl or C++ or java tags.

So the only serious candidate is python, and what I would suggest, if someone at some point wants to start doing this, is that python-2 and python-3 be supplemental and not replacements for python.

Which then begs the question to what they should be applied, and this is where I'd argue it may be a nuance that's still unnecessary here, since ideally I think they should apply to questions that are specifically and explicitly questions about API differences across versions, which are questions that belong on S.O. period.

However, I might have used C++11 on S.O. questions without said idealism at work simply because I used some C++11 idiom. I don't know if this is an argument for or against having python-x available.

My final point about this is it is a basic fact about a language which most users will run across while they are learning the language -- and we are not here to teach people python. There's some expectation that they have a minimal degree of competence in order to be asking a pi specific question. Occasionally it is really clear when someone doesn't (can't use conditionals/loops properly, etc.) and hopefully either those get a quick answer or else they are closed as off-topic. In that context:

  • Is it worth it to do this just as a friendly heads up?

  • Is it even effective that way? If I didn't know about it, am I likely to notice because a tag says python-3, that hey, there's more that one incompatible version of the language in widespread use?

  • Will it be used enough to make it effective that way?

In short I'm not opposed to new tags (as long as they aren't used to replace python), but it is not something I would put time into.

0

I'm a python programmer. While there are many questions where a distinction between Python 2 and 3 isn't necessary. For some it would be good to have the different tags.

Version 3 is on the verge to become the dominant version. Python 3 was struggling a long time to become the default one. I guess this is mainly due to the very large amount of libraries out there for python which needed to be portet by volunteers.

I don't have a list of which Raspberry PI Linux has which Python installed by default and which version will turn up if one simply calls python --version. But on my laptop with Ubuntu 16.04 this is still Python 2.7.12.

You must log in to answer this question.

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