sympy/sympy — pull request #2318 by flacjacket (2013-07-25 01:01:08+00:00)
Title: [WIP] Single Python 2 and 3 compatible codebase

Refactor the codebase to be both Python 2 and 3 compatable. Main changes include:

- Absolute imports with leading `.`.

- Python 3 print function rather than print statement.

- String in Python 3 are always unicode, so unicode related functions have been removed.

- Integers in Python 3 are always "long", `long` methods and suffixing long numbers with `L` are not supported

- `map`, `filter`, and `range` return iterables rather than lists, where needed, wrap these calls in `list()`. As such, the Python 2 iterable forms of these, such as `xrange` and `ifilter`, have been removed.

- `exec` is a function rather than a statement.

- Iterators in Python 3 do not have `.next()` methods. Instead, `next()` can be used (Python >=2.6).

Changes related to Python 2 and 3 compatibility are in sympy.core.compatibility.

### Current status

This should give a fully functioning version of SymPy for Python 2 and 3, passing tests for both and doctests for 3 (the printing doctests in 2 won't pass).

### TODO
[ ] Fix doctests for Python 2 (maybe use something similar to wrappers implemented for IPython?)
[ ] Have setup.py install `isympy3` (may need a few changes to setup.py, importing setuptools)
[ ] Check that all files not directly tested with tests/doctests are Python 3 compatible