protobuf: Delete some __new__ and __init__ methods (#8088)

This commit is contained in:
Alex Waygood
2022-06-16 16:10:14 +01:00
committed by GitHub
parent 4967c8bc12
commit 43f923b6c2
2 changed files with 9 additions and 68 deletions

View File

@@ -23,3 +23,12 @@ google.protobuf.text_format.MessageToBytes
# Stubbed as static method, but actually exists as a property that's
# a function. Typeshed's typing is more useful
google.protobuf.service.Service.GetDescriptor
# These are deliberately omitted in the stub
# due to the fact that these classes have conflicting signatures for __init__/__new__.
# The classes also can't be constructed directly anyway,
# so the signatures of their constructors are somewhat irrelevant.
google.protobuf.descriptor.Descriptor.__init__
google.protobuf.descriptor.Descriptor.__new__
google.protobuf.descriptor.ServiceDescriptor.__init__
google.protobuf.descriptor.ServiceDescriptor.__new__

View File

@@ -45,27 +45,6 @@ class _NestedDescriptorBase(DescriptorBase):
def CopyToProto(self, proto): ...
class Descriptor(_NestedDescriptorBase):
def __new__(
cls,
name=...,
full_name=...,
filename=...,
containing_type=...,
fields=...,
nested_types=...,
enum_types=...,
extensions=...,
options=...,
serialized_options=...,
is_extendable=...,
extension_ranges=...,
oneofs=...,
file=...,
serialized_start=...,
serialized_end=...,
syntax=...,
create_key=...,
): ...
fields: Any
fields_by_number: Any
fields_by_name: Any
@@ -81,27 +60,6 @@ class Descriptor(_NestedDescriptorBase):
oneofs: Any
oneofs_by_name: Any
syntax: Any
def __init__(
self,
name,
full_name,
filename,
containing_type,
fields,
nested_types,
enum_types,
extensions,
options=...,
serialized_options=...,
is_extendable=...,
extension_ranges=...,
oneofs=...,
file=...,
serialized_start=...,
serialized_end=...,
syntax=...,
create_key=...,
) -> None: ...
def EnumValueName(self, enum, value): ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> MessageOptions: ...
@@ -266,35 +224,9 @@ class OneofDescriptor:
def GetOptions(self) -> OneofOptions: ...
class ServiceDescriptor(_NestedDescriptorBase):
def __new__(
cls,
name=...,
full_name=...,
index=...,
methods=...,
options=...,
serialized_options=...,
file=...,
serialized_start=...,
serialized_end=...,
create_key=...,
): ...
index: Any
methods: Any
methods_by_name: Any
def __init__(
self,
name,
full_name,
index,
methods,
options=...,
serialized_options=...,
file=...,
serialized_start=...,
serialized_end=...,
create_key=...,
) -> None: ...
def FindMethodByName(self, name): ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> ServiceOptions: ...