New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__future__ environments #1671
__future__ environments #1671
Conversation
I think this behavior does match my expectations, thanks! |
Can you rebase? One of the big merges touched the run_cell signature as well. |
Will do, although it ma |
Allow the %run magic with '-b' to specify a file.
… sharing __future__ imports.
I'm not sure why I closed this one - looks like I hit the wrong button somewhere. Reopened and rebased. |
The Travis failure appears to be a problem with Travis, not the code. |
Test results for commit 0de3a99 merged into master (cdc7e66)
Not available for testing: python2.6 |
That failure is some problem with PySide/PyQt, unrelated to this. |
This looks good to me. Want to add a test? |
nose.tools no longer has a fail() function
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 |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
This looks good to me. Anything ore you want to add / confirm? |
Nope, that's great. Merging now. |
__future__ environments
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.