Annotate extension methods in protobuf message (#4706)

This commit is contained in:
Ethan Pronovost
2020-10-27 01:14:48 -07:00
committed by GitHub
parent 4603728a15
commit f81e479861

View File

@@ -2,7 +2,7 @@ import sys
from typing import Any, ByteString, Sequence, Tuple, Type, TypeVar, Union
from .descriptor import Descriptor, FieldDescriptor
from .internal.extension_dict import _ExtensionDict
from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor
class Error(Exception): ...
class DecodeError(Error): ...
@@ -30,8 +30,8 @@ class Message:
def SerializeToString(self, deterministic: bool = ...) -> bytes: ...
def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ...
def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ...
def HasExtension(self, extension_handle): ...
def ClearExtension(self, extension_handle): ...
def HasExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> bool: ...
def ClearExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> None: ...
def ByteSize(self) -> int: ...
@classmethod
def FromString(cls: Type[_M], s: _Serialized) -> _M: ...