Repository navigation
fix for #10327 : replacing support for get_ipython().magic() - #10638
Conversation
….run_line_magic()
…on().run_line_magic()
|
It seems that the tests should also need to be changed in order to accommodate the changes. The checks are failing at those points. Are we changing the test cases? |
…on().run_line_magic()
|
Hi there, thanks you probably want to synchronize with #10612 which is also trying to update this. |
|
Summary:
|
| magic_kind=magic_kind, magic_name=magic_name) | ||
|
|
||
| def run_line_magic(self, magic_name, line): | ||
| def run_line_magic(self, magic_name, line, back_compat=False): |
There was a problem hiding this comment.
Maybe make the parameter _stack_depth=1 rather than back_compat=False - that's a bit clearer about what it means. The leading underscore would suggest that it's not for normal use.
| [(u'a =% who', "a = get_ipython().magic({u}'who')"), | ||
| (u'b = %who', "b = get_ipython().magic({u}'who')"), | ||
| (u'c= %ls', "c = get_ipython().magic({u}'ls')"), | ||
| [(u'a =% who', "a = get_ipython().run_line_magic({u}'who', {u}'')"), |
There was a problem hiding this comment.
So long as we're targeting IPython 6.x, we can get rid of the {u} things in the tests - that's for Python 2 compatibility, which we've dropped now.
…oved from core/tests
|
@takluyver |
|
Thanks |
There was no direct calls made to
get_ipython().run_line_magic(), instead we were callingget_ipython().magic()first which callsget_ipython().run_line_magic()from it's body. That was the reasonhist -tshowingget_ipython().magic()instead ofget_ipython().run_line_magic()because that's what was happening in there.I replaced calls to
get_ipython().magic()byget_ipython().run_line_magic(). But, there are some tests inIPython/core/tests/..which still make calls toget_ipython().magic(). I haven't changed them.#10327