mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-04 22:31:26 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Self
|
||||
|
||||
from .descriptor import Descriptor, FieldDescriptor
|
||||
from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor
|
||||
@@ -13,11 +13,11 @@ _M = TypeVar("_M", bound=Message) # message type (of self)
|
||||
|
||||
class Message:
|
||||
DESCRIPTOR: Descriptor
|
||||
def __deepcopy__(self: Self, memo: Any = ...) -> Self: ...
|
||||
def __deepcopy__(self, memo: Any = ...) -> Self: ...
|
||||
def __eq__(self, other_msg): ...
|
||||
def __ne__(self, other_msg): ...
|
||||
def MergeFrom(self: Self, other_msg: Self) -> None: ...
|
||||
def CopyFrom(self: Self, other_msg: Self) -> None: ...
|
||||
def MergeFrom(self, other_msg: Self) -> None: ...
|
||||
def CopyFrom(self, other_msg: Self) -> None: ...
|
||||
def Clear(self) -> None: ...
|
||||
def SetInParent(self) -> None: ...
|
||||
def IsInitialized(self) -> bool: ...
|
||||
@@ -34,7 +34,7 @@ class Message:
|
||||
def Extensions(self: _M) -> _ExtensionDict[_M]: ...
|
||||
def ByteSize(self) -> int: ...
|
||||
@classmethod
|
||||
def FromString(cls: type[Self], s: bytes) -> Self: ...
|
||||
def FromString(cls, s: bytes) -> Self: ...
|
||||
# Intentionally left out typing on these three methods, because they are
|
||||
# stringly typed and it is not useful to call them on a Message directly.
|
||||
# We prefer more specific typing on individual subclasses of Message
|
||||
|
||||
Reference in New Issue
Block a user