Skip to content

Commit

Permalink
add __repr__ to MagicsDisplay (#14378)
Browse files Browse the repository at this point in the history
Here's more details on the `rich` side:

Textualize/rich#3317

I don't see a good reason not to overload `__repr__` in this use case
  • Loading branch information
Carreau committed Mar 31, 2024
2 parents 43f9010 + fe89dea commit a570c92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || (
echo "Changes need auto-formatting. Run:"
echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522"
echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522 ."
echo "then commit and push changes to fix."
exit 1
)
3 changes: 3 additions & 0 deletions IPython/core/magics/basic.py
Expand Up @@ -40,6 +40,9 @@ def _lsmagic(self):
def _repr_pretty_(self, p, cycle):
p.text(self._lsmagic())

def __repr__(self):
return self.__str__()

def __str__(self):
return self._lsmagic()

Expand Down

0 comments on commit a570c92

Please sign in to comment.