Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

__future__ environments #1671

merged 5 commits into from Jan 18, 2013


None yet
2 participants

takluyver commented Apr 28, 2012

So far, this just closes the .ipy hole, so .py and .ipy files have the same behaviour with respect to future, both for %run and as startup files.

There was some discussion on the mailing list about whether %run should share the shell's __future__, or only %run -i. Either way, this will need a bit more thought, because it interacts with the other options that can be passed to %run, especially for profiling and debugging.

%rerun and macros will share the shell's futures - I think this is expected.


minrk commented May 2, 2012

I think this behavior does match my expectations, thanks!


minrk commented Jun 1, 2012

Can you rebase? One of the big merges touched the run_cell signature as well.


takluyver commented Jun 2, 2012

Will do, although it ma

@takluyver takluyver closed this Jun 2, 2012

@takluyver takluyver reopened this Jan 14, 2013


takluyver commented Jan 14, 2013

I'm not sure why I closed this one - looks like I hit the wrong button somewhere. Reopened and rebased.


takluyver commented Jan 14, 2013

The Travis failure appears to be a problem with Travis, not the code.


takluyver commented Jan 14, 2013

Test results for commit 0de3a99 merged into master (cdc7e66)
Platform: linux2

  • python2.7: Failed, log at https://gist.github.com/4530575 (libraries not available: azure oct2py pymongo)
  • python3.2: OK (libraries not available: azure oct2py pymongo wx wx.aui)

Not available for testing: python2.6


takluyver commented Jan 14, 2013

That failure is some problem with PySide/PyQt, unrelated to this.


minrk commented Jan 15, 2013

This looks good to me. Want to add a test?


takluyver commented Jan 17, 2013

I added a test, and it turned up a minor issue, which required a couple more API changes. I guess it shows how important it is to test everything.

I also noticed a coincidental failure (caused by a file in the working directory where I run the test) was trying to use a now-nonexistant nose.tools.fail() function, so I changed that.

@takluyver takluyver commented on the diff Jan 17, 2013

@@ -90,7 +90,7 @@ def __init__(self):
# Now, we must monkeypatch the linecache directly so that parts of the
# stdlib that call it outside our control go through our codepath
# (otherwise we'd lose our tracebacks).
- linecache.checkcache = self.check_cache
+ linecache.checkcache = check_linecache_ipython

takluyver Jan 17, 2013


I've made this a standalone function, so that linecache isn't holding a reference to the last CachingCompiler() we created. It didn't need to be a method in the first place.


minrk commented Jan 18, 2013

This looks good to me. Anything ore you want to add / confirm?


takluyver commented Jan 18, 2013

Nope, that's great. Merging now.

@takluyver takluyver added a commit that referenced this pull request Jan 18, 2013

@takluyver takluyver Merge pull request #1671 from takluyver/back-to-the-future
__future__ environments

@takluyver takluyver merged commit 0aacf47 into ipython:master Jan 18, 2013

1 check passed

default The Travis build passed

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

@takluyver takluyver Merge pull request #1671 from takluyver/back-to-the-future
__future__ environments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment