language-python icon indicating copy to clipboard operation
language-python copied to clipboard

A snippet for common imports to make Python 2 code work in Python 3

Open brettcannon opened this issue 10 years ago • 0 comments

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

Bonus points for also supporting six to pull in replaced built-ins:

from six.moves import filter, input, map, range, zip

brettcannon avatar Feb 23 '15 23:02 brettcannon