Last active
February 8, 2017 13:13
-
-
Save deehzee/ff8e99708a86463931b3780545d5910a to your computer and use it in GitHub Desktop.
Common Python 2-3 Compatibility Fixes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some common idioms to make Python work both in version 2.7 and 3.x | |
# For more examples, see: | |
# http://python-future.org/compatible_idioms.html | |
# Absolute import | |
from __future__ import absolute_import | |
# Floating point division | |
from __future__ import division | |
# Print function | |
from __future__ import print_function | |
# Unicode literals | |
from __future__ import unicode_literals |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment