Use Python 2 and 3 dict iteration methods.
Use the Python print function instead of statements.
Python 3 does not have unicode and long types.
Remove the xrange function to support Python 3.
Use the builtin next to support iterators in Python 2 and 3
Replace types.StringType with str for Python 3
Change how a code object is retrieved depending on the Python version.