tarmstrong/nbdiff

Python3 support?

Opened this issue · 3 comments

Thanks for supply this great tool for the community.

When I try to install it I got some warnings related with the use of print statement instead of print function since I'm using Python3 and didn't notice any information about it in README. There is any plan to supply a Python3 compatible version?

Thanks! It shouldn't be too hard to support python3. I'll see if I can find some time to port it, but pull requests are welcome.

When using 2to3 there are some changes that I don't know the best way to keep it compatible with Python2:

  • replace urllib2 with urllib.request at nbdiff/server/command/MergeURLCommand.py and nbdiff/server/command/DiffURLCommand.py,
  • replace __nonzero__ with __bool__ at nbdiff/server/database/__init__.py,
  • keys() behavior at nbdiff/adapter/git_adapter.py.

Just use if PY3 constructs. For nonzero, just keep both methods, with one equals the other.