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
Inconsistent underscore behavior in IPython #11325
Comments
There is a bug here, and it's the behavior in the first example. IPython only intends to create the |
it's slightly more tricky as we need rotate _ -> __ -> ___ as well, and we do identity check internally to know wether our internal tracking should update the user namespace. The problem is that the So the internal logic really believe that
It looks like the second time it does the right thing, but in fact, it does not update That is going to be really tricky to fix. |
As a word of warning (for those, like me, struggling with this issue), the suggestion that underscore is an alias of The safer way to get the result of the most recent execution that yielded a result is Note that Another note: This does not get you the result (if any) of the most recent execution as such, because executions that did not yield a result (such as |
We just ran into this same issue with In [1]: from ibis import _
In [2]: _
Out[2]: <ibis.expr.deferred.Deferred at 0x7f3415de6b30>
In [3]: 1
Out[3]: 1
In [4]: _ # overwritten!
Out[4]: 1 In [1]: 1 # run a cell to pre-populate `_`
Out[1]: 1
In [2]: from ibis import _
In [3]: _
Out[3]: <ibis.expr.deferred.Deferred at 0x7fd7409caec0>
In [4]: 1
Out[4]: 1
In [5]: _ # not overwritten
Out[5]: <ibis.expr.deferred.Deferred at 0x7fd7409caec0> |
Is there some reason that
Out[8]
should not matchOut[4]
?I originally thought this was a Jupyter Notebook issue (jupyter/notebook#3943) but now I think it is an IPython Issue.
The text was updated successfully, but these errors were encountered: