mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
correct changed import
This commit is contained in:
parent
6c940d6159
commit
aa3066925a
1 changed files with 2 additions and 2 deletions
|
@ -118,10 +118,10 @@ The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of
|
||||||
the handling of types already supported. This example shows how special support
|
the handling of types already supported. This example shows how special support
|
||||||
for file objects could be added::
|
for file objects could be added::
|
||||||
|
|
||||||
import repr
|
import reprlib
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class MyRepr(repr.Repr):
|
class MyRepr(reprlib.Repr):
|
||||||
def repr_file(self, obj, level):
|
def repr_file(self, obj, level):
|
||||||
if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
|
if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
|
||||||
return obj.name
|
return obj.name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue