mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL
|
||||
from _typeshed import ReadableBuffer, Self, WriteableBuffer
|
||||
from _typeshed import ReadableBuffer, WriteableBuffer
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from typing import Any, ClassVar, Generic, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -77,15 +77,15 @@ class _CData(metaclass=_CDataMeta):
|
||||
_b_needsfree_: bool
|
||||
_objects: Mapping[Any, int] | None
|
||||
@classmethod
|
||||
def from_buffer(cls: type[Self], source: WriteableBuffer, offset: int = ...) -> Self: ...
|
||||
def from_buffer(cls, source: WriteableBuffer, offset: int = ...) -> Self: ...
|
||||
@classmethod
|
||||
def from_buffer_copy(cls: type[Self], source: ReadableBuffer, offset: int = ...) -> Self: ...
|
||||
def from_buffer_copy(cls, source: ReadableBuffer, offset: int = ...) -> Self: ...
|
||||
@classmethod
|
||||
def from_address(cls: type[Self], address: int) -> Self: ...
|
||||
def from_address(cls, address: int) -> Self: ...
|
||||
@classmethod
|
||||
def from_param(cls: type[Self], obj: Any) -> Self | _CArgObject: ...
|
||||
def from_param(cls, obj: Any) -> Self | _CArgObject: ...
|
||||
@classmethod
|
||||
def in_dll(cls: type[Self], library: CDLL, name: str) -> Self: ...
|
||||
def in_dll(cls, library: CDLL, name: str) -> Self: ...
|
||||
|
||||
class _CanCastTo(_CData): ...
|
||||
class _PointerLike(_CanCastTo): ...
|
||||
|
||||
Reference in New Issue
Block a user