mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-05 14:44:18 +08:00
Added __class_getitem__ (#4695)
Resolves #4682 Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -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 = ...
|
||||
|
||||
Reference in New Issue
Block a user