Skip to content

Commit 42e2142

Browse files
ilevkivskyiambv
authored andcommitted
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
1 parent 485c232 commit 42e2142

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

third_party/2and3/typing_extensions.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ from typing import overload as overload
1111
from typing import Text as Text
1212
from typing import Type as Type
1313
from typing import TYPE_CHECKING as TYPE_CHECKING
14+
from typing import TypeVar, Any
15+
16+
_TC = TypeVar('_TC', bound=Type[object])
17+
class _SpecialForm:
18+
def __getitem__(self, typeargs: Any) -> Any: ...
19+
def runtime(cls: _TC) -> _TC: ...
20+
Protocol: _SpecialForm = ...
1421

1522
if sys.version_info >= (3, 3):
1623
from typing import ChainMap as ChainMap

0 commit comments

Comments
 (0)