mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from http.client import HTTPResponse
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, TypeVar, overload
|
||||
from urllib.request import Request
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -102,10 +102,10 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
strict_ns_set_initial_dollar: bool = ...,
|
||||
strict_ns_set_path: bool = ...,
|
||||
) -> None: ...
|
||||
def blocked_domains(self) -> Tuple[str, ...]: ...
|
||||
def blocked_domains(self) -> tuple[str, ...]: ...
|
||||
def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ...
|
||||
def is_blocked(self, domain: str) -> bool: ...
|
||||
def allowed_domains(self) -> Tuple[str, ...] | None: ...
|
||||
def allowed_domains(self) -> tuple[str, ...] | None: ...
|
||||
def set_allowed_domains(self, allowed_domains: Sequence[str] | None) -> None: ...
|
||||
def is_not_allowed(self, domain: str) -> bool: ...
|
||||
def set_ok_version(self, cookie: Cookie, request: Request) -> bool: ... # undocumented
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Dict, Generic, Iterable, Mapping, TypeVar, Union, overload
|
||||
from typing import Any, Generic, Iterable, Mapping, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -18,7 +18,7 @@ def _unquote(str: str) -> str: ...
|
||||
|
||||
class CookieError(Exception): ...
|
||||
|
||||
class Morsel(Dict[str, Any], Generic[_T]):
|
||||
class Morsel(dict[str, Any], Generic[_T]):
|
||||
value: str
|
||||
coded_value: _T
|
||||
key: str
|
||||
@@ -40,7 +40,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
|
||||
class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
|
||||
def __init__(self, input: _DataType | None = ...) -> None: ...
|
||||
def value_decode(self, val: str) -> _T: ...
|
||||
def value_encode(self, val: _T) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user