Drop extra IO type properties only needed by Python 3.6

Python 3.7 is now our minimum-supported Python, and so we don't need to add
these properties any more.

See #2566.
This commit is contained in:
Dave Pearson 2022-10-10 16:32:50 +01:00
parent 419265ba3f
commit 873cb79705
No known key found for this signature in database
GPG Key ID: B413E0EF113D4ABF
2 changed files with 0 additions and 16 deletions

View File

@ -4,19 +4,6 @@ from typing import IO, Iterable, Iterator, List, Optional, Type
class NullFile(IO[str]): class NullFile(IO[str]):
# TODO: "mode", "name" and "closed" are only required for Python 3.6.
@property
def mode(self) -> str:
return ""
@property
def name(self) -> str:
return "NullFile"
def closed(self) -> bool:
return False
def close(self) -> None: def close(self) -> None:
pass pass

View File

@ -5,9 +5,6 @@ def test_null_file():
file = NullFile() file = NullFile()
with file: with file:
assert file.write("abc") == 0 assert file.write("abc") == 0
assert file.mode == ""
assert file.name == "NullFile"
assert not file.closed()
assert file.close() is None assert file.close() is None
assert not file.isatty() assert not file.isatty()
assert file.read() == "" assert file.read() == ""