Remove subclass IOBase from TextIOBase. (#1505)

This used to cause TextIOBase to subclass both BinaryIO and TextIO, even
though those two are incompatible.
This commit is contained in:
Matthias Kramm
2017-07-28 21:07:37 -07:00
committed by Guido van Rossum
parent 2d97894fa9
commit 6f23d124c0
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Union
from typing import Any, Union, IO
import io
FASYNC = ... # type: int
@@ -72,7 +72,7 @@ LOCK_SH = ... # type: int
LOCK_UN = ... # type: int
LOCK_WRITE = ... # type: int
_ANYFILE = Union[int, io.IOBase]
_ANYFILE = Union[int, IO]
# TODO All these return either int or bytes depending on the value of
# cmd (not on the type of arg).

View File

@@ -39,5 +39,7 @@ class RawIOBase(_io._RawIOBase, IOBase):
class BufferedIOBase(_io._BufferedIOBase, IOBase):
pass
class TextIOBase(_io._TextIOBase, IOBase): # type: ignore
# Note: In the actual io.py, TextIOBase subclasses IOBase.
# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.)
class TextIOBase(_io._TextIOBase):
pass