IPython to python 3 compat