Skip to content

Commit

Permalink
Drop extra IO type properties only needed by Python 3.6
Browse files Browse the repository at this point in the history
Python 3.7 is now our minimum-supported Python, and so we don't need to add
these properties any more.

See Textualize#2566.
  • Loading branch information
davep committed Oct 10, 2022
1 parent 419265b commit 873cb79
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
13 changes: 0 additions & 13 deletions rich/_null_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@

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:
pass

Expand Down
3 changes: 0 additions & 3 deletions tests/test_null_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ def test_null_file():
file = NullFile()
with file:
assert file.write("abc") == 0
assert file.mode == ""
assert file.name == "NullFile"
assert not file.closed()
assert file.close() is None
assert not file.isatty()
assert file.read() == ""
Expand Down

0 comments on commit 873cb79

Please sign in to comment.