Add Protocol and runtime to typing_extensions (#1564)

* Add Protocol and runtime to typing_extensions

* Use private type variable

* Fix typo

* Bound type variable for runtime to only class objects

* Conform to version check specification
This commit is contained in:
Ivan Levkivskyi
2017-08-21 22:22:48 +02:00
committed by Łukasz Langa
parent 485c232409
commit 42e2142f28

View File

@@ -11,6 +11,13 @@ from typing import overload as overload
from typing import Text as Text
from typing import Type as Type
from typing import TYPE_CHECKING as TYPE_CHECKING
from typing import TypeVar, Any
_TC = TypeVar('_TC', bound=Type[object])
class _SpecialForm:
def __getitem__(self, typeargs: Any) -> Any: ...
def runtime(cls: _TC) -> _TC: ...
Protocol: _SpecialForm = ...
if sys.version_info >= (3, 3):
from typing import ChainMap as ChainMap