summaryrefslogtreecommitdiff
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-03-09 00:07:03 +0000
committerBenjamin Peterson <benjamin@python.org>2009-03-09 00:07:03 +0000
commitb566e1330eee7e83b4e1e511691981a8e28bbf11 (patch)
tree1ebea485cbe6d38e66fa5a60e69319fd4da9e74e /Lib/_pyio.py
parent553bdaf5bf622fae099935fb737be06919532b07 (diff)
downloadcpython-b566e1330eee7e83b4e1e511691981a8e28bbf11.tar.gz
give TextIOWrapper a repr that tells you the encoding
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index c6811dbb2b..535c9ca433 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -1399,6 +1399,9 @@ class TextIOWrapper(TextIOBase):
# - "bytes_..." for integer variables that count input bytes
# - "chars_..." for integer variables that count decoded characters
+ def __repr__(self):
+ return "<TextIOWrapper encoding={0}>".format(self.encoding)
+
@property
def encoding(self):
return self._encoding