mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Makes DESCRIPTOR non nullable again (#7125)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
google.protobuf\..*_pb2\..*
|
||||
|
||||
google.protobuf.internal.containers.BaseContainer.sort
|
||||
# While Message and Descriptor are both defined with a null DESCRIPTOR,
|
||||
# subclasses of Message and instances of EnumTypeWrapper require this value to
|
||||
# be set, and since these type stubs are intended for use with protoc-generated
|
||||
# python it's more accurate to make them non-nullable.
|
||||
google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper.DESCRIPTOR
|
||||
google.protobuf.message.Message.DESCRIPTOR
|
||||
google.protobuf.message.Message.SerializePartialToString
|
||||
google.protobuf.message.Message.SerializeToString
|
||||
google.protobuf.service.Service.GetDescriptor
|
||||
|
||||
@@ -7,7 +7,7 @@ _V = TypeVar("_V", bound=int)
|
||||
# Expose a generic version so that those using mypy-protobuf
|
||||
# can get autogenerated NewType wrapper around the int values
|
||||
class _EnumTypeWrapper(Generic[_V]):
|
||||
DESCRIPTOR: EnumDescriptor | None
|
||||
DESCRIPTOR: EnumDescriptor
|
||||
def __init__(self, enum_type: EnumDescriptor) -> None: ...
|
||||
def Name(self, number: _V) -> str: ...
|
||||
def Value(self, name: Text | bytes) -> _V: ...
|
||||
|
||||
@@ -11,7 +11,7 @@ class EncodeError(Error): ...
|
||||
_M = TypeVar("_M", bound=Message) # message type (of self)
|
||||
|
||||
class Message:
|
||||
DESCRIPTOR: Descriptor | None
|
||||
DESCRIPTOR: Descriptor
|
||||
def __deepcopy__(self, memo=...): ...
|
||||
def __eq__(self, other_msg): ...
|
||||
def __ne__(self, other_msg): ...
|
||||
|
||||
Reference in New Issue
Block a user