7

In 2015 I asked a question about how to do something in Python, and got a great answer, with my requested functionality nicely wrapped in a function.

Now I've just received a new answer, which notes that as of Python 3.8, my requested functionality is built int to python.

I like the older answer because it works across many versions of Python, and I like the new answer because it shows the built-in functionality.

Note that this isn't a clear Python 2 / Python 3 split.

What's the best way to handle this?

4
  • Tag with the version you're using in addition to [python]? There's not really much you can do unless you specified the version in the first place, and it probably has value to someone else who actually uses Python 3.8 Commented Jul 30, 2019 at 3:07
  • I'm wondering if "int to" was intentional :)
    – Davy M
    Commented Jul 30, 2019 at 3:56
  • 4
    I'm not sure what you want to "handle"? Seems like everything is working fine.
    – Mat
    Commented Jul 30, 2019 at 4:51
  • It's pity then that the new answerer didn't think to answer for both contingencies. Commented Jul 30, 2019 at 14:47

2 Answers 2

5

Upvote both answers.

Both the old answer and the new answer are useful, as long as they specify which versions of Python they apply to.

You can clarify the old answer's applicability by leaving a comment on it: "Works in Python 2 and Python 3."

3

I am not sure in which context you had asked keeping the question up to date by adding a new tag python 3.x or something. If I'm in the right direction then I will not add a new tag as the original post was asking solution in the context of python 2.x

As you have said got a great answer, with my requested functionality nicely wrapped in a function. The original answer should remain the accepted one which solved the issue (it works across many versions of Python may be for Python 3.x also). For new answer what you can do is an upvote as it also provides the solution whoever looking for a similar issue.

You must log in to answer this question.

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