Closed ckald closed 9 years ago
Thanks! Could you rebase your PR to the current master branch rossant/ipycache
?
Strange, I forked from master half an hour before submitting the PR
Ok, I will take care of it
I'm going to test this soon on ipython3 with python 3 and 2 kernels
unfortunately, some changes I made to enable instantaneous printing breaks python3
compatibility (something to do with StringIO
). Don't have time to fix this so I'm going to remove the python3
builds again... sorry
Please be more specific. What's the problem with StringIO?
of any interest? https://pythonhosted.org/six/#six.StringIO
It's ok, it was straightforward, after all. They renamed the buf
argument in the StringIO
constructor so just initializing with StringIO(self, buf)
works fine. I fixed that along with the ipynb_runner.py
script in a PR (rossant/ipycache#26) which I will soon merge.
One problem I see is that we will need to be careful with python3
compatibility even in the example notebooks (i.e., no careless using of print variable
any longer :-( because the notebooks are also tested for each python version...
The six module looks fine but so far we don't really need it and should probably wait using it as a dependency?
What is typically done is that this six.py
module is copied as is in the repository, so we don't have an extra dependency. In my experience it is quite convenient because you don't have to deal with py2/py3 compat issues yourself. Just use the functions and objects from this namespace and you're good.
print()
should always be used instead of print
because this works in both py2 and py3.
Ideally the notebooks should be tested in both py2 and py3. When IPython 3.0 is released in a few weeks, the nbformat will change and the notebooks may need to be updated. Also the new nbformat will include py2 or py3 in the notebook metadata. Maybe it would be worth having py2_notebooks
and py3_notebooks
folders or something.
sounds good. Let's wait for IPython 3.0, then.
Additionally, "%"-formatting should be replaced by ".format()". I can't think of any other major adjustment
also dictionary iteration has changed https://pythonhosted.org/six/#six.iterkeys
Haven't tested in the wild so far