mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, AnyStr, Callable, Generic, Mapping, NamedTuple, Sequence, Tuple, Union, overload
|
||||
from typing import Any, AnyStr, Callable, Generic, Mapping, NamedTuple, Sequence, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -35,7 +35,7 @@ class _NetlocResultMixinBase(Generic[AnyStr]):
|
||||
class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ...
|
||||
class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ...
|
||||
|
||||
class _DefragResultBase(Tuple[Any, ...], Generic[AnyStr]):
|
||||
class _DefragResultBase(tuple[Any, ...], Generic[AnyStr]):
|
||||
url: AnyStr
|
||||
fragment: AnyStr
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from _typeshed import StrOrBytesPath
|
||||
from email.message import Message
|
||||
from http.client import HTTPMessage, HTTPResponse, _HTTPConnectionProtocol
|
||||
from http.cookiejar import CookieJar
|
||||
from typing import IO, Any, Callable, ClassVar, Mapping, NoReturn, Pattern, Sequence, Tuple, TypeVar, overload
|
||||
from typing import IO, Any, Callable, ClassVar, Mapping, NoReturn, Pattern, Sequence, TypeVar, overload
|
||||
from urllib.error import HTTPError
|
||||
from urllib.response import addclosehook, addinfourl
|
||||
|
||||
@@ -196,9 +196,9 @@ class HTTPSHandler(AbstractHTTPHandler):
|
||||
def https_request(self, request: Request) -> Request: ... # undocumented
|
||||
|
||||
class FileHandler(BaseHandler):
|
||||
names: ClassVar[Tuple[str, ...] | None] # undocumented
|
||||
names: ClassVar[tuple[str, ...] | None] # undocumented
|
||||
def file_open(self, req: Request) -> addinfourl: ...
|
||||
def get_names(self) -> Tuple[str, ...]: ... # undocumented
|
||||
def get_names(self) -> tuple[str, ...]: ... # undocumented
|
||||
def open_local_file(self, req: Request) -> addinfourl: ... # undocumented
|
||||
|
||||
class DataHandler(BaseHandler):
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import Self
|
||||
from email.message import Message
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Tuple, Type, TypeVar
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Type, TypeVar
|
||||
|
||||
_AIUT = TypeVar("_AIUT", bound=addbase)
|
||||
|
||||
@@ -37,7 +37,7 @@ class addbase(BinaryIO):
|
||||
|
||||
class addclosehook(addbase):
|
||||
closehook: Callable[..., object]
|
||||
hookargs: Tuple[Any, ...]
|
||||
hookargs: tuple[Any, ...]
|
||||
def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ...
|
||||
|
||||
class addinfo(addbase):
|
||||
|
||||
Reference in New Issue
Block a user