I'm not interested in warming up the "Python 2 or Python 3?" questions (even though the most recent one I found is over one year old), but I stumbled upon this claim:
You can write the Python 3 code under Python 2 if your file begins with the line:
from __future__ import absolute_import, division, generators, unicode_literals, print_function, nested_scopes, with_statement
With that line in place, your code will work with either Python 2 or Python 3. There may be rare cases in which it doesn't work, but I have not found any,
Is this true? Is this single line enough to make sure the code you write will run on both Python 2.x (>=2.5 I assume) and 3.x (assuming the modules imported are available in both)?