mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import enum
|
||||
import socket
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
|
||||
from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, NamedTuple, overload
|
||||
from typing_extensions import Literal, TypeAlias, TypedDict, final
|
||||
from typing_extensions import Literal, Self, TypeAlias, TypedDict, final
|
||||
|
||||
_PCTRTT: TypeAlias = tuple[tuple[str, str], ...]
|
||||
_PCTRTTT: TypeAlias = tuple[_PCTRTT, ...]
|
||||
@@ -297,9 +297,9 @@ class _ASN1Object(NamedTuple):
|
||||
longname: str
|
||||
oid: str
|
||||
@classmethod
|
||||
def fromnid(cls: type[Self], nid: int) -> Self: ...
|
||||
def fromnid(cls, nid: int) -> Self: ...
|
||||
@classmethod
|
||||
def fromname(cls: type[Self], name: str) -> Self: ...
|
||||
def fromname(cls, name: str) -> Self: ...
|
||||
|
||||
class Purpose(_ASN1Object, enum.Enum):
|
||||
SERVER_AUTH: _ASN1Object
|
||||
@@ -383,9 +383,9 @@ class SSLContext:
|
||||
if sys.version_info >= (3, 10):
|
||||
# Using the default (None) for the `protocol` parameter is deprecated,
|
||||
# but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted
|
||||
def __new__(cls: type[Self], protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ...
|
||||
def __new__(cls, protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ...
|
||||
else:
|
||||
def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
|
||||
def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
|
||||
|
||||
def cert_store_stats(self) -> dict[str, int]: ...
|
||||
def load_cert_chain(
|
||||
|
||||
Reference in New Issue
Block a user