give TextIOWrapper a repr that tells you the encoding

This commit is contained in:
Benjamin Peterson 2009-03-09 00:07:03 +00:00
parent f2b55fb5ee
commit c4c0eaebbf
3 changed files with 19 additions and 2 deletions

View file

@ -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