@@ -171,17 +171,21 @@ The :mod:`pprint` module defines one class:
171171
172172.. function :: isrecursive(object)
173173
174- Determine if *object * requires a recursive representation.
174+ Determine if *object * requires a recursive representation. This function is
175+ subject to the same limitations as noted in :func: `saferepr ` below and may raise an
176+ :exc: `RecursionError ` if it fails to detect a recursive object.
175177
176178
177179One more support function is also defined:
178180
179181.. function :: saferepr(object)
180182
181- Return a string representation of *object *, protected against recursive data
182- structures. If the representation of *object * exposes a recursive entry, the
183- recursive reference will be represented as ``<Recursion on typename with
184- id=number> ``. The representation is not otherwise formatted.
183+ Return a string representation of *object *, protected against recursion in
184+ some common data structures, namely instances of :class: `dict `, :class: `list `
185+ and :class: `tuple ` or subclasses whose ``__repr__ `` has not been overridden. If the
186+ representation of object exposes a recursive entry, the recursive reference
187+ will be represented as ``<Recursion on typename with id=number> ``. The
188+ representation is not otherwise formatted.
185189
186190 >>> pprint.saferepr(stuff)
187191 "[<Recursion on list with id=...>, 'spam', 'eggs', 'lumberjack', 'knights', 'ni']"
0 commit comments