diff --git a/docs/source/pretty.rst b/docs/source/pretty.rst index f1c9afaf..323f2f9e 100644 --- a/docs/source/pretty.rst +++ b/docs/source/pretty.rst @@ -166,4 +166,8 @@ This will change the output of the Rich repr example to the following:: } -Note that you can add ``__rich_repr__`` methods to third-party libraries *without* including Rich as a dependency. If Rich is not installed, then nothing will break. Hopefully more third-party libraries will adopt Rich repr methods in the future. \ No newline at end of file +Note that you can add ``__rich_repr__`` methods to third-party libraries *without* including Rich as a dependency. If Rich is not installed, then nothing will break. Hopefully more third-party libraries will adopt Rich repr methods in the future. + +## Example + +See `repr.py `_ for the example code used in this page. \ No newline at end of file diff --git a/examples/repr.py b/examples/repr.py index 1d5085b1..7af5bdcd 100644 --- a/examples/repr.py +++ b/examples/repr.py @@ -15,6 +15,8 @@ class Bird: yield "fly", self.fly, True yield "extinct", self.extinct, False + # __rich_repr__.angular = True + from rich import print