Fix applying @needs_global_scope to cell magics.#11698
Merged
minrk merged 1 commit intoipython:masterfrom Apr 23, 2019
Merged
Conversation
There was some side effect in some magic to allow passing needs_local_scope. We know pass the global_scope to cell magice when using @needs_local_scope, but at the same time this means that we can't rely on the existance of local_ns from within the magic to know wheter we are cell-called or line called. Fixes ipython#11659
This was referenced Apr 23, 2019
|
I can verify that this fixes the original problem I reported in #11659 (at least, on my local machine -- I'll wait until 7.5.0 comes out to test on Travis, but that shouldn't make any difference). In addition, I see no unexpected side effects in the rest of our test suite (our system tests are in notebooks). Tested in Py 3.6. Thanks for the fix! |
Member
Author
|
Thanks @dwhswenson and @minrk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was some side effect in some magic to allow passing
needs_local_scope. We know pass the global_scope to cell magice when
using @needs_local_scope, but at the same time this means that we can't
rely on the existance of local_ns from within the magic to know wheter
we are cell-called or line called.
Fixes #11659