Fix abstract classes for Python 3 (#2239)

* add metaclass=ABCMeta to some classes

* mark some more classes as explicitly abstract

* make some more classes concrete
This commit is contained in:
Jelle Zijlstra
2018-06-16 10:18:54 -07:00
committed by GitHub
parent 341fa375ef
commit 94ab32ba59
10 changed files with 32 additions and 15 deletions

View File

@@ -178,7 +178,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
# NOTE: This type does not exist in typing.py or PEP 484.
# The parameters corrrespond to Generator, but the 4th is the original type.
class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co],
Generic[_T_co, _T_contra, _V_co, _S]):
Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta):
pass
@runtime
@@ -465,7 +465,7 @@ class TextIO(IO[str]):
@abstractmethod
def __enter__(self) -> TextIO: ...
class ByteString(Sequence[int]): ...
class ByteString(Sequence[int], metaclass=ABCMeta): ...
class Match(Generic[AnyStr]):
pos = 0