mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
give TextIOWrapper a repr that tells you the encoding
This commit is contained in:
parent
f2b55fb5ee
commit
c4c0eaebbf
3 changed files with 19 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue