summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-03-09 00:07:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-03-09 00:07:03 (GMT)
commitc4c0eaebbff47a70bcdbc97d9b57e57b977efb5d (patch)
treeee6ed5cd1fc352607a41a9acffef867e5aa5bf51 /Lib/_pyio.py
parentf2b55fb5ee0374babd770dd5aabad5045a1f78dc (diff)
downloadcpython-c4c0eaebbff47a70bcdbc97d9b57e57b977efb5d.zip
cpython-c4c0eaebbff47a70bcdbc97d9b57e57b977efb5d.tar.gz
cpython-c4c0eaebbff47a70bcdbc97d9b57e57b977efb5d.tar.bz2
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 c6811db..535c9ca 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