Skip to content
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

[BUG] Installing in REPL breaks _ builtin #235

Closed
The-Compiler opened this issue Aug 18, 2020 · 2 comments · Fixed by #238
Closed

[BUG] Installing in REPL breaks _ builtin #235

The-Compiler opened this issue Aug 18, 2020 · 2 comments · Fixed by #238
Labels
accepted Task was accepted bug Something isn't working

Comments

@The-Compiler
Copy link
Contributor

The-Compiler commented Aug 18, 2020

Describe the bug
When using from rich import pretty; pretty.install(), the _ (last result) functionality of Python's REPL breaks.

To Reproduce

Without rich:

>>> 5 + 10
15
>>> _ / 2
7.5

With rich:

>>> from rich import pretty
>>> pretty.install()
>>> 5 + 10
15
>>> _ / 2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '_' is not defined

When rich is installed after the first expression:

>>> 1300 + 36
1336
>>> from rich import pretty
>>> pretty.install()
>>> 21 * 2
42
>>> _ + 1
1337

Platform
Linux, rich 5.1.2 and 5.2.0, Python 3.8.5

@willmcgugan willmcgugan added accepted Task was accepted bug Something isn't working and removed Needs triage labels Aug 19, 2020
@willmcgugan
Copy link
Collaborator

Please try v5.2.1

@The-Compiler
Copy link
Contributor Author

Looks good now - thanks for the quick fix! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Task was accepted bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants