From: Berker Peksag Date: Sun, 12 Oct 2014 02:11:16 +0000 (+0300) Subject: Issue #22613: Fix reprlib.Repr subclass example on Python 3. X-Git-Tag: v3.5.0a1~691^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edd6ec2dd38d0251adecfafb3cfe821afd14dd34;p=python Issue #22613: Fix reprlib.Repr subclass example on Python 3. Reported by Jacques Ducasse. --- diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index ee682635be..1c694f920f 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -148,11 +148,11 @@ for file objects could be added:: import sys class MyRepr(reprlib.Repr): - def repr_file(self, obj, level): - if obj.name in ['', '', '']: + + def repr_TextIOWrapper(self, obj, level): + if obj.name in {'', '', ''}: return obj.name - else: - return repr(obj) + return repr(obj) aRepr = MyRepr() print(aRepr.repr(sys.stdin)) # prints ''