Added __class_getitem__ (#4695)

Resolves #4682

Co-authored-by: hauntsaninja <>
This commit is contained in:
Utsav
2020-10-23 02:35:04 +05:30
committed by GitHub
parent 5927e5ca30
commit 6f943d43ea
32 changed files with 205 additions and 6 deletions

View File

@@ -4,6 +4,9 @@ from types import TracebackType
from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, overload
from typing_extensions import Literal
if sys.version_info >= (3, 9):
from types import GenericAlias
# global variables
TMP_MAX: int
tempdir: Optional[str]
@@ -287,6 +290,8 @@ class TemporaryDirectory(Generic[AnyStr]):
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
def mkstemp(
suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ..., text: bool = ...