diff options
author | Georg Brandl <georg@python.org> | 2009-01-03 20:47:01 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-03 20:47:01 (GMT) |
commit | e92818f58c134549c8820073037a1655330bbea1 (patch) | |
tree | f223e03ec73fdfed4c6f7eb375e55eddf399808e /Doc/library/repr.rst | |
parent | ae24e7b5a2cfeb3e40ea6e619c01d27a79cf740c (diff) | |
download | cpython-e92818f58c134549c8820073037a1655330bbea1.zip cpython-e92818f58c134549c8820073037a1655330bbea1.tar.gz cpython-e92818f58c134549c8820073037a1655330bbea1.tar.bz2 |
Fix uses of the default role.
Diffstat (limited to 'Doc/library/repr.rst')
-rw-r--r-- | Doc/library/repr.rst | 6 |
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>' |