summaryrefslogtreecommitdiffstats
path: root/Doc/library/repr.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/repr.rst')
-rw-r--r--Doc/library/repr.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/repr.rst b/Doc/library/repr.rst
index 29c5a61..2b75257 100644
--- a/Doc/library/repr.rst
+++ b/Doc/library/repr.rst
@@ -125,15 +125,15 @@ The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of
the handling of types already supported. This example shows how special support
for file objects could be added::
- import repr
+ import repr as reprlib
import sys
- class MyRepr(repr.Repr):
+ class MyRepr(reprlib.Repr):
def repr_file(self, obj, level):
if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
return obj.name
else:
- return `obj`
+ return repr(obj)
aRepr = MyRepr()
print aRepr.repr(sys.stdin) # prints '<stdin>'