Skip to main content
8 of 8
tag fence
cottontail
  • 22.3k
  • 6
  • 24
  • 53

When is it permissible to update other people's answers for Python 3?

When is it permissible to update other people's answers for Python 3?

It's a slippery slope. But it would be such a minor change. Look at this little gem:

with open("datafile") as myfile:
    head = [next(myfile) for x in xrange(N)]
print head

Of course, xrange() is now just range(), and print is now print().

At some point in the (near) future, examples like this will no longer be relevant since new users will most likely start with Python 3 or later.

What's the plan?

I imagine an organic change will happen regardless: OPs editing their examples, adding the tag. And then maybe users updating other people's simple snippets like this gem.

Of course, the obvious problem is the breakdown of comment relatedness. The above example is a good one, because its comments refer to both Python2 and Python3, and these comments would be irrational if the code was updated.

A related meta-topic are questions of this sort, How to deal with hugely upvoted, bad and outdated answers?.

xtian
  • 2.9k
  • 15
  • 8