diff --git a/third_party/2/google/protobuf/__init__.pyi b/third_party/2/google/protobuf/__init__.pyi deleted file mode 100644 index d23216480..000000000 --- a/third_party/2/google/protobuf/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -__version__ = ... # type: str diff --git a/third_party/2/google/protobuf/internal/enum_type_wrapper.pyi b/third_party/2/google/protobuf/internal/enum_type_wrapper.pyi deleted file mode 100644 index ced66b89e..000000000 --- a/third_party/2/google/protobuf/internal/enum_type_wrapper.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any, List, Tuple - -class EnumTypeWrapper(object): - def __init__(self, enum_type: Any) -> None: ... - def Name(self, number: int) -> str: ... - def Value(self, name: str) -> int: ... - def keys(self) -> List[str]: ... - def values(self) -> List[int]: ... - - @classmethod - def items(cls) -> List[Tuple[str, int]]: ... diff --git a/third_party/2/google/__init__.pyi b/third_party/2and3/google/__init__.pyi similarity index 100% rename from third_party/2/google/__init__.pyi rename to third_party/2and3/google/__init__.pyi diff --git a/third_party/2and3/google/protobuf/__init__.pyi b/third_party/2and3/google/protobuf/__init__.pyi new file mode 100644 index 000000000..535c1f762 --- /dev/null +++ b/third_party/2and3/google/protobuf/__init__.pyi @@ -0,0 +1 @@ +__version__ = ... # type: bytes diff --git a/third_party/2/google/protobuf/any_pb2.pyi b/third_party/2and3/google/protobuf/any_pb2.pyi similarity index 74% rename from third_party/2/google/protobuf/any_pb2.pyi rename to third_party/2and3/google/protobuf/any_pb2.pyi index d66e3cec4..ca69cf421 100644 --- a/third_party/2/google/protobuf/any_pb2.pyi +++ b/third_party/2and3/google/protobuf/any_pb2.pyi @@ -11,12 +11,12 @@ from typing import ( class Any(Message, well_known_types.Any_): type_url = ... # type: Text - value = ... # type: str + value = ... # type: bytes def __init__(self, type_url: Optional[Text] = ..., - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> Any: ... + def FromString(cls, s: bytes) -> Any: ... diff --git a/third_party/2/google/protobuf/any_test_pb2.pyi b/third_party/2and3/google/protobuf/any_test_pb2.pyi similarity index 93% rename from third_party/2/google/protobuf/any_test_pb2.pyi rename to third_party/2and3/google/protobuf/any_test_pb2.pyi index 2e1053db4..580178226 100644 --- a/third_party/2/google/protobuf/any_test_pb2.pyi +++ b/third_party/2and3/google/protobuf/any_test_pb2.pyi @@ -29,4 +29,4 @@ class TestAny(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAny: ... + def FromString(cls, s: bytes) -> TestAny: ... diff --git a/third_party/2/google/protobuf/api_pb2.pyi b/third_party/2and3/google/protobuf/api_pb2.pyi similarity index 94% rename from third_party/2/google/protobuf/api_pb2.pyi rename to third_party/2and3/google/protobuf/api_pb2.pyi index 9ca6842c8..0ff4be52c 100644 --- a/third_party/2/google/protobuf/api_pb2.pyi +++ b/third_party/2and3/google/protobuf/api_pb2.pyi @@ -46,7 +46,7 @@ class Api(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Api: ... + def FromString(cls, s: bytes) -> Api: ... class Method(Message): @@ -71,7 +71,7 @@ class Method(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Method: ... + def FromString(cls, s: bytes) -> Method: ... class Mixin(Message): @@ -84,4 +84,4 @@ class Mixin(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Mixin: ... + def FromString(cls, s: bytes) -> Mixin: ... diff --git a/third_party/2/google/protobuf/compiler/__init__.pyi b/third_party/2and3/google/protobuf/compiler/__init__.pyi similarity index 100% rename from third_party/2/google/protobuf/compiler/__init__.pyi rename to third_party/2and3/google/protobuf/compiler/__init__.pyi diff --git a/third_party/2/google/protobuf/compiler/plugin_pb2.pyi b/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi similarity index 89% rename from third_party/2/google/protobuf/compiler/plugin_pb2.pyi rename to third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi index 813ffc89e..874c79678 100644 --- a/third_party/2/google/protobuf/compiler/plugin_pb2.pyi +++ b/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi @@ -29,7 +29,7 @@ class Version(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Version: ... + def FromString(cls, s: bytes) -> Version: ... class CodeGeneratorRequest(Message): @@ -50,7 +50,7 @@ class CodeGeneratorRequest(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CodeGeneratorRequest: ... + def FromString(cls, s: bytes) -> CodeGeneratorRequest: ... class CodeGeneratorResponse(Message): @@ -67,7 +67,7 @@ class CodeGeneratorResponse(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CodeGeneratorResponse.File: ... + def FromString(cls, s: bytes) -> CodeGeneratorResponse.File: ... error = ... # type: Text @property @@ -79,4 +79,4 @@ class CodeGeneratorResponse(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CodeGeneratorResponse: ... + def FromString(cls, s: bytes) -> CodeGeneratorResponse: ... diff --git a/third_party/2/google/protobuf/descriptor.pyi b/third_party/2and3/google/protobuf/descriptor.pyi similarity index 99% rename from third_party/2/google/protobuf/descriptor.pyi rename to third_party/2and3/google/protobuf/descriptor.pyi index 7258837e6..7acdd2ed1 100644 --- a/third_party/2/google/protobuf/descriptor.pyi +++ b/third_party/2and3/google/protobuf/descriptor.pyi @@ -158,4 +158,4 @@ class FileDescriptor(DescriptorBase): def CopyToProto(self, proto): ... def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ... -def _ParseOptions(message: Message, string: str) -> Message: ... +def _ParseOptions(message: Message, string: bytes) -> Message: ... diff --git a/third_party/2/google/protobuf/descriptor_pb2.pyi b/third_party/2and3/google/protobuf/descriptor_pb2.pyi similarity index 86% rename from third_party/2/google/protobuf/descriptor_pb2.pyi rename to third_party/2and3/google/protobuf/descriptor_pb2.pyi index 60247dd3d..424755d1f 100644 --- a/third_party/2/google/protobuf/descriptor_pb2.pyi +++ b/third_party/2and3/google/protobuf/descriptor_pb2.pyi @@ -25,7 +25,7 @@ class FileDescriptorSet(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FileDescriptorSet: ... + def FromString(cls, s: bytes) -> FileDescriptorSet: ... class FileDescriptorProto(Message): @@ -74,7 +74,7 @@ class FileDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FileDescriptorProto: ... + def FromString(cls, s: bytes) -> FileDescriptorProto: ... class DescriptorProto(Message): @@ -93,7 +93,7 @@ class DescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DescriptorProto.ExtensionRange: ... + def FromString(cls, s: bytes) -> DescriptorProto.ExtensionRange: ... class ReservedRange(Message): start = ... # type: int @@ -105,7 +105,7 @@ class DescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DescriptorProto.ReservedRange: ... + def FromString(cls, s: bytes) -> DescriptorProto.ReservedRange: ... name = ... # type: Text reserved_name = ... # type: RepeatedScalarFieldContainer[Text] @@ -154,7 +154,7 @@ class DescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DescriptorProto: ... + def FromString(cls, s: bytes) -> DescriptorProto: ... class ExtensionRangeOptions(Message): @@ -168,7 +168,7 @@ class ExtensionRangeOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ExtensionRangeOptions: ... + def FromString(cls, s: bytes) -> ExtensionRangeOptions: ... class FieldDescriptorProto(Message): @@ -176,19 +176,19 @@ class FieldDescriptorProto(Message): class Type(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> FieldDescriptorProto.Type: ... + def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[FieldDescriptorProto.Type]: ... @classmethod - def items(cls) -> List[Tuple[str, FieldDescriptorProto.Type]]: ... + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ... TYPE_DOUBLE: Type TYPE_FLOAT: Type TYPE_INT64: Type @@ -211,19 +211,19 @@ class FieldDescriptorProto(Message): class Label(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> FieldDescriptorProto.Label: ... + def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[FieldDescriptorProto.Label]: ... @classmethod - def items(cls) -> List[Tuple[str, FieldDescriptorProto.Label]]: ... + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ... LABEL_OPTIONAL: Label LABEL_REQUIRED: Label LABEL_REPEATED: Label @@ -254,7 +254,7 @@ class FieldDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FieldDescriptorProto: ... + def FromString(cls, s: bytes) -> FieldDescriptorProto: ... class OneofDescriptorProto(Message): @@ -269,7 +269,7 @@ class OneofDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> OneofDescriptorProto: ... + def FromString(cls, s: bytes) -> OneofDescriptorProto: ... class EnumDescriptorProto(Message): @@ -285,7 +285,7 @@ class EnumDescriptorProto(Message): @classmethod def FromString( - cls, s: str) -> EnumDescriptorProto.EnumReservedRange: ... + cls, s: bytes) -> EnumDescriptorProto.EnumReservedRange: ... name = ... # type: Text reserved_name = ... # type: RepeatedScalarFieldContainer[Text] @@ -309,7 +309,7 @@ class EnumDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> EnumDescriptorProto: ... + def FromString(cls, s: bytes) -> EnumDescriptorProto: ... class EnumValueDescriptorProto(Message): @@ -326,7 +326,7 @@ class EnumValueDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> EnumValueDescriptorProto: ... + def FromString(cls, s: bytes) -> EnumValueDescriptorProto: ... class ServiceDescriptorProto(Message): @@ -346,7 +346,7 @@ class ServiceDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ServiceDescriptorProto: ... + def FromString(cls, s: bytes) -> ServiceDescriptorProto: ... class MethodDescriptorProto(Message): @@ -369,7 +369,7 @@ class MethodDescriptorProto(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MethodDescriptorProto: ... + def FromString(cls, s: bytes) -> MethodDescriptorProto: ... class FileOptions(Message): @@ -377,19 +377,19 @@ class FileOptions(Message): class OptimizeMode(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> FileOptions.OptimizeMode: ... + def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[FileOptions.OptimizeMode]: ... @classmethod - def items(cls) -> List[Tuple[str, FileOptions.OptimizeMode]]: ... + def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ... SPEED: OptimizeMode CODE_SIZE: OptimizeMode LITE_RUNTIME: OptimizeMode @@ -439,7 +439,7 @@ class FileOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FileOptions: ... + def FromString(cls, s: bytes) -> FileOptions: ... class MessageOptions(Message): @@ -461,7 +461,7 @@ class MessageOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MessageOptions: ... + def FromString(cls, s: bytes) -> MessageOptions: ... class FieldOptions(Message): @@ -469,19 +469,19 @@ class FieldOptions(Message): class CType(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> FieldOptions.CType: ... + def Value(cls, name: bytes) -> FieldOptions.CType: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[FieldOptions.CType]: ... @classmethod - def items(cls) -> List[Tuple[str, FieldOptions.CType]]: ... + def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ... STRING: CType CORD: CType STRING_PIECE: CType @@ -489,19 +489,19 @@ class FieldOptions(Message): class JSType(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> FieldOptions.JSType: ... + def Value(cls, name: bytes) -> FieldOptions.JSType: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[FieldOptions.JSType]: ... @classmethod - def items(cls) -> List[Tuple[str, FieldOptions.JSType]]: ... + def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ... JS_NORMAL: JSType JS_STRING: JSType JS_NUMBER: JSType @@ -527,7 +527,7 @@ class FieldOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FieldOptions: ... + def FromString(cls, s: bytes) -> FieldOptions: ... class OneofOptions(Message): @@ -541,7 +541,7 @@ class OneofOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> OneofOptions: ... + def FromString(cls, s: bytes) -> OneofOptions: ... class EnumOptions(Message): @@ -559,7 +559,7 @@ class EnumOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> EnumOptions: ... + def FromString(cls, s: bytes) -> EnumOptions: ... class EnumValueOptions(Message): @@ -575,7 +575,7 @@ class EnumValueOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> EnumValueOptions: ... + def FromString(cls, s: bytes) -> EnumValueOptions: ... class ServiceOptions(Message): @@ -591,7 +591,7 @@ class ServiceOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ServiceOptions: ... + def FromString(cls, s: bytes) -> ServiceOptions: ... class MethodOptions(Message): @@ -599,19 +599,19 @@ class MethodOptions(Message): class IdempotencyLevel(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> MethodOptions.IdempotencyLevel: ... + def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[MethodOptions.IdempotencyLevel]: ... @classmethod - def items(cls) -> List[Tuple[str, MethodOptions.IdempotencyLevel]]: ... + def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ... IDEMPOTENCY_UNKNOWN: IdempotencyLevel NO_SIDE_EFFECTS: IdempotencyLevel IDEMPOTENT: IdempotencyLevel @@ -629,7 +629,7 @@ class MethodOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MethodOptions: ... + def FromString(cls, s: bytes) -> MethodOptions: ... class UninterpretedOption(Message): @@ -644,12 +644,12 @@ class UninterpretedOption(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> UninterpretedOption.NamePart: ... + def FromString(cls, s: bytes) -> UninterpretedOption.NamePart: ... identifier_value = ... # type: Text positive_int_value = ... # type: int negative_int_value = ... # type: int double_value = ... # type: float - string_value = ... # type: str + string_value = ... # type: bytes aggregate_value = ... # type: Text @property @@ -662,12 +662,12 @@ class UninterpretedOption(Message): positive_int_value: Optional[int] = ..., negative_int_value: Optional[int] = ..., double_value: Optional[float] = ..., - string_value: Optional[str] = ..., + string_value: Optional[bytes] = ..., aggregate_value: Optional[Text] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> UninterpretedOption: ... + def FromString(cls, s: bytes) -> UninterpretedOption: ... class SourceCodeInfo(Message): @@ -688,7 +688,7 @@ class SourceCodeInfo(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SourceCodeInfo.Location: ... + def FromString(cls, s: bytes) -> SourceCodeInfo.Location: ... @property def location( @@ -699,7 +699,7 @@ class SourceCodeInfo(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SourceCodeInfo: ... + def FromString(cls, s: bytes) -> SourceCodeInfo: ... class GeneratedCodeInfo(Message): @@ -718,7 +718,7 @@ class GeneratedCodeInfo(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> GeneratedCodeInfo.Annotation: ... + def FromString(cls, s: bytes) -> GeneratedCodeInfo.Annotation: ... @property def annotation( @@ -729,4 +729,4 @@ class GeneratedCodeInfo(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> GeneratedCodeInfo: ... + def FromString(cls, s: bytes) -> GeneratedCodeInfo: ... diff --git a/third_party/2/google/protobuf/descriptor_pool.pyi b/third_party/2and3/google/protobuf/descriptor_pool.pyi similarity index 100% rename from third_party/2/google/protobuf/descriptor_pool.pyi rename to third_party/2and3/google/protobuf/descriptor_pool.pyi diff --git a/third_party/2/google/protobuf/duration_pb2.pyi b/third_party/2and3/google/protobuf/duration_pb2.pyi similarity index 89% rename from third_party/2/google/protobuf/duration_pb2.pyi rename to third_party/2and3/google/protobuf/duration_pb2.pyi index efa8f2099..9d8fc6664 100644 --- a/third_party/2/google/protobuf/duration_pb2.pyi +++ b/third_party/2and3/google/protobuf/duration_pb2.pyi @@ -18,4 +18,4 @@ class Duration(Message, well_known_types.Duration): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Duration: ... + def FromString(cls, s: bytes) -> Duration: ... diff --git a/third_party/2/google/protobuf/empty_pb2.pyi b/third_party/2and3/google/protobuf/empty_pb2.pyi similarity index 75% rename from third_party/2/google/protobuf/empty_pb2.pyi rename to third_party/2and3/google/protobuf/empty_pb2.pyi index 6541b5eca..295ebfa93 100644 --- a/third_party/2/google/protobuf/empty_pb2.pyi +++ b/third_party/2and3/google/protobuf/empty_pb2.pyi @@ -9,4 +9,4 @@ class Empty(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Empty: ... + def FromString(cls, s: bytes) -> Empty: ... diff --git a/third_party/2/google/protobuf/field_mask_pb2.pyi b/third_party/2and3/google/protobuf/field_mask_pb2.pyi similarity index 90% rename from third_party/2/google/protobuf/field_mask_pb2.pyi rename to third_party/2and3/google/protobuf/field_mask_pb2.pyi index 5f83745b6..e90f95058 100644 --- a/third_party/2/google/protobuf/field_mask_pb2.pyi +++ b/third_party/2and3/google/protobuf/field_mask_pb2.pyi @@ -21,4 +21,4 @@ class FieldMask(Message, well_known_types.FieldMask): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FieldMask: ... + def FromString(cls, s: bytes) -> FieldMask: ... diff --git a/third_party/2/google/protobuf/internal/__init__.pyi b/third_party/2and3/google/protobuf/internal/__init__.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/__init__.pyi rename to third_party/2and3/google/protobuf/internal/__init__.pyi diff --git a/third_party/2/google/protobuf/internal/containers.pyi b/third_party/2and3/google/protobuf/internal/containers.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/containers.pyi rename to third_party/2and3/google/protobuf/internal/containers.pyi diff --git a/third_party/2/google/protobuf/internal/decoder.pyi b/third_party/2and3/google/protobuf/internal/decoder.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/decoder.pyi rename to third_party/2and3/google/protobuf/internal/decoder.pyi diff --git a/third_party/2/google/protobuf/internal/encoder.pyi b/third_party/2and3/google/protobuf/internal/encoder.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/encoder.pyi rename to third_party/2and3/google/protobuf/internal/encoder.pyi diff --git a/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi b/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi new file mode 100644 index 000000000..61d6ea10c --- /dev/null +++ b/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Tuple + +class EnumTypeWrapper(object): + def __init__(self, enum_type: Any) -> None: ... + def Name(self, number: int) -> bytes: ... + def Value(self, name: bytes) -> int: ... + def keys(self) -> List[bytes]: ... + def values(self) -> List[int]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, int]]: ... diff --git a/third_party/2/google/protobuf/internal/message_listener.pyi b/third_party/2and3/google/protobuf/internal/message_listener.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/message_listener.pyi rename to third_party/2and3/google/protobuf/internal/message_listener.pyi diff --git a/third_party/2/google/protobuf/internal/well_known_types.pyi b/third_party/2and3/google/protobuf/internal/well_known_types.pyi similarity index 97% rename from third_party/2/google/protobuf/internal/well_known_types.pyi rename to third_party/2and3/google/protobuf/internal/well_known_types.pyi index b397309aa..695d9d193 100644 --- a/third_party/2/google/protobuf/internal/well_known_types.pyi +++ b/third_party/2and3/google/protobuf/internal/well_known_types.pyi @@ -8,7 +8,7 @@ class ParseError(Error): ... class Any_: type_url: Any = ... value: Any = ... - def Pack(self, msg: Any, type_url_prefix: str = ..., deterministic: Optional[Any] = ...) -> None: ... + def Pack(self, msg: Any, type_url_prefix: bytes = ..., deterministic: Optional[Any] = ...) -> None: ... def Unpack(self, msg: Any): ... def TypeName(self): ... def Is(self, descriptor: Any): ... diff --git a/third_party/2/google/protobuf/internal/wire_format.pyi b/third_party/2and3/google/protobuf/internal/wire_format.pyi similarity index 100% rename from third_party/2/google/protobuf/internal/wire_format.pyi rename to third_party/2and3/google/protobuf/internal/wire_format.pyi diff --git a/third_party/2/google/protobuf/map_proto2_unittest_pb2.pyi b/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi similarity index 83% rename from third_party/2/google/protobuf/map_proto2_unittest_pb2.pyi rename to third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi index 9534b3043..c7f87e5be 100644 --- a/third_party/2/google/protobuf/map_proto2_unittest_pb2.pyi +++ b/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi @@ -18,19 +18,19 @@ from typing import ( class Proto2MapEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> Proto2MapEnum: ... + def Value(cls, name: bytes) -> Proto2MapEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[Proto2MapEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, Proto2MapEnum]]: ... + def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ... PROTO2_MAP_ENUM_FOO: Proto2MapEnum PROTO2_MAP_ENUM_BAR: Proto2MapEnum PROTO2_MAP_ENUM_BAZ: Proto2MapEnum @@ -39,19 +39,19 @@ PROTO2_MAP_ENUM_BAZ: Proto2MapEnum class Proto2MapEnumPlusExtra(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> Proto2MapEnumPlusExtra: ... + def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[Proto2MapEnumPlusExtra]: ... @classmethod - def items(cls) -> List[Tuple[str, Proto2MapEnumPlusExtra]]: ... + def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ... E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra @@ -70,7 +70,7 @@ class TestEnumMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMap.KnownMapFieldEntry: ... + def FromString(cls, s: bytes) -> TestEnumMap.KnownMapFieldEntry: ... class UnknownMapFieldEntry(Message): key = ... # type: int @@ -82,7 +82,7 @@ class TestEnumMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMap.UnknownMapFieldEntry: ... + def FromString(cls, s: bytes) -> TestEnumMap.UnknownMapFieldEntry: ... @property def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... @@ -96,7 +96,7 @@ class TestEnumMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMap: ... + def FromString(cls, s: bytes) -> TestEnumMap: ... class TestEnumMapPlusExtra(Message): @@ -111,7 +111,7 @@ class TestEnumMapPlusExtra(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMapPlusExtra.KnownMapFieldEntry: ... + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.KnownMapFieldEntry: ... class UnknownMapFieldEntry(Message): key = ... # type: int @@ -123,7 +123,7 @@ class TestEnumMapPlusExtra(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMapPlusExtra.UnknownMapFieldEntry: ... + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.UnknownMapFieldEntry: ... @property def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... @@ -137,7 +137,7 @@ class TestEnumMapPlusExtra(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumMapPlusExtra: ... + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra: ... class TestImportEnumMap(Message): @@ -152,7 +152,7 @@ class TestImportEnumMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestImportEnumMap.ImportEnumAmpEntry: ... + def FromString(cls, s: bytes) -> TestImportEnumMap.ImportEnumAmpEntry: ... @property def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ... @@ -162,7 +162,7 @@ class TestImportEnumMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestImportEnumMap: ... + def FromString(cls, s: bytes) -> TestImportEnumMap: ... class TestIntIntMap(Message): @@ -177,7 +177,7 @@ class TestIntIntMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestIntIntMap.MEntry: ... + def FromString(cls, s: bytes) -> TestIntIntMap.MEntry: ... @property def m(self) -> MutableMapping[int, int]: ... @@ -187,7 +187,7 @@ class TestIntIntMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestIntIntMap: ... + def FromString(cls, s: bytes) -> TestIntIntMap: ... class TestMaps(Message): @@ -204,7 +204,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MInt32Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MInt32Entry: ... class MInt64Entry(Message): key = ... # type: int @@ -218,7 +218,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MInt64Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MInt64Entry: ... class MUint32Entry(Message): key = ... # type: int @@ -232,7 +232,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MUint32Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MUint32Entry: ... class MUint64Entry(Message): key = ... # type: int @@ -246,7 +246,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MUint64Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MUint64Entry: ... class MSint32Entry(Message): key = ... # type: int @@ -260,7 +260,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MSint32Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MSint32Entry: ... class MSint64Entry(Message): key = ... # type: int @@ -274,7 +274,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MSint64Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MSint64Entry: ... class MFixed32Entry(Message): key = ... # type: int @@ -288,7 +288,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MFixed32Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MFixed32Entry: ... class MFixed64Entry(Message): key = ... # type: int @@ -302,7 +302,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MFixed64Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MFixed64Entry: ... class MSfixed32Entry(Message): key = ... # type: int @@ -316,7 +316,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MSfixed32Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MSfixed32Entry: ... class MSfixed64Entry(Message): key = ... # type: int @@ -330,7 +330,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MSfixed64Entry: ... + def FromString(cls, s: bytes) -> TestMaps.MSfixed64Entry: ... class MBoolEntry(Message): key = ... # type: bool @@ -344,7 +344,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MBoolEntry: ... + def FromString(cls, s: bytes) -> TestMaps.MBoolEntry: ... class MStringEntry(Message): key = ... # type: Text @@ -358,7 +358,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps.MStringEntry: ... + def FromString(cls, s: bytes) -> TestMaps.MStringEntry: ... @property def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ... @@ -412,7 +412,7 @@ class TestMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMaps: ... + def FromString(cls, s: bytes) -> TestMaps: ... class TestSubmessageMaps(Message): @@ -425,4 +425,4 @@ class TestSubmessageMaps(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestSubmessageMaps: ... + def FromString(cls, s: bytes) -> TestSubmessageMaps: ... diff --git a/third_party/2/google/protobuf/map_unittest_pb2.pyi b/third_party/2and3/google/protobuf/map_unittest_pb2.pyi similarity index 82% rename from third_party/2/google/protobuf/map_unittest_pb2.pyi rename to third_party/2and3/google/protobuf/map_unittest_pb2.pyi index 2d146d593..e0137d570 100644 --- a/third_party/2/google/protobuf/map_unittest_pb2.pyi +++ b/third_party/2and3/google/protobuf/map_unittest_pb2.pyi @@ -23,19 +23,19 @@ from typing import ( class MapEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> MapEnum: ... + def Value(cls, name: bytes) -> MapEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[MapEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, MapEnum]]: ... + def items(cls) -> List[Tuple[bytes, MapEnum]]: ... MAP_ENUM_FOO: MapEnum @@ -55,7 +55,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32Int32Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32Int32Entry: ... class MapInt64Int64Entry(Message): key = ... # type: int @@ -67,7 +67,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt64Int64Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt64Int64Entry: ... class MapUint32Uint32Entry(Message): key = ... # type: int @@ -79,7 +79,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapUint32Uint32Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapUint32Uint32Entry: ... class MapUint64Uint64Entry(Message): key = ... # type: int @@ -91,7 +91,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapUint64Uint64Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapUint64Uint64Entry: ... class MapSint32Sint32Entry(Message): key = ... # type: int @@ -103,7 +103,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapSint32Sint32Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapSint32Sint32Entry: ... class MapSint64Sint64Entry(Message): key = ... # type: int @@ -115,7 +115,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapSint64Sint64Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapSint64Sint64Entry: ... class MapFixed32Fixed32Entry(Message): key = ... # type: int @@ -127,7 +127,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapFixed32Fixed32Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapFixed32Fixed32Entry: ... class MapFixed64Fixed64Entry(Message): key = ... # type: int @@ -139,7 +139,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapFixed64Fixed64Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapFixed64Fixed64Entry: ... class MapSfixed32Sfixed32Entry(Message): key = ... # type: int @@ -151,7 +151,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapSfixed32Sfixed32Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapSfixed32Sfixed32Entry: ... class MapSfixed64Sfixed64Entry(Message): key = ... # type: int @@ -163,7 +163,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapSfixed64Sfixed64Entry: ... + def FromString(cls, s: bytes) -> TestMap.MapSfixed64Sfixed64Entry: ... class MapInt32FloatEntry(Message): key = ... # type: int @@ -175,7 +175,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32FloatEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32FloatEntry: ... class MapInt32DoubleEntry(Message): key = ... # type: int @@ -187,7 +187,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32DoubleEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32DoubleEntry: ... class MapBoolBoolEntry(Message): key = ... # type: bool @@ -199,7 +199,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapBoolBoolEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapBoolBoolEntry: ... class MapStringStringEntry(Message): key = ... # type: Text @@ -211,19 +211,19 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapStringStringEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapStringStringEntry: ... class MapInt32BytesEntry(Message): key = ... # type: int - value = ... # type: str + value = ... # type: bytes def __init__(self, key: Optional[int] = ..., - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32BytesEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32BytesEntry: ... class MapInt32EnumEntry(Message): key = ... # type: int @@ -235,7 +235,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32EnumEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32EnumEntry: ... class MapInt32ForeignMessageEntry(Message): key = ... # type: int @@ -249,7 +249,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32ForeignMessageEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32ForeignMessageEntry: ... class MapStringForeignMessageEntry(Message): key = ... # type: Text @@ -264,7 +264,7 @@ class TestMap(Message): @classmethod def FromString( - cls, s: str) -> TestMap.MapStringForeignMessageEntry: ... + cls, s: bytes) -> TestMap.MapStringForeignMessageEntry: ... class MapInt32AllTypesEntry(Message): key = ... # type: int @@ -278,7 +278,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.MapInt32AllTypesEntry: ... + def FromString(cls, s: bytes) -> TestMap.MapInt32AllTypesEntry: ... @property def map_int32_int32(self) -> MutableMapping[int, int]: ... @@ -323,7 +323,7 @@ class TestMap(Message): def map_string_string(self) -> MutableMapping[Text, Text]: ... @property - def map_int32_bytes(self) -> MutableMapping[int, str]: ... + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... @property def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... @@ -354,7 +354,7 @@ class TestMap(Message): map_int32_double: Optional[Mapping[int, float]]=..., map_bool_bool: Optional[Mapping[bool, bool]]=..., map_string_string: Optional[Mapping[Text, Text]]=..., - map_int32_bytes: Optional[Mapping[int, str]]=..., + map_int32_bytes: Optional[Mapping[int, bytes]]=..., map_int32_enum: Optional[Mapping[int, MapEnum]]=..., map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]]=..., map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]]=..., @@ -362,7 +362,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap: ... + def FromString(cls, s: bytes) -> TestMap: ... class TestMapSubmessage(Message): @@ -375,7 +375,7 @@ class TestMapSubmessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMapSubmessage: ... + def FromString(cls, s: bytes) -> TestMapSubmessage: ... class TestMessageMap(Message): @@ -392,7 +392,7 @@ class TestMessageMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageMap.MapInt32MessageEntry: ... + def FromString(cls, s: bytes) -> TestMessageMap.MapInt32MessageEntry: ... @property def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ... @@ -402,7 +402,7 @@ class TestMessageMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageMap: ... + def FromString(cls, s: bytes) -> TestMessageMap: ... class TestSameTypeMap(Message): @@ -417,7 +417,7 @@ class TestSameTypeMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestSameTypeMap.Map1Entry: ... + def FromString(cls, s: bytes) -> TestSameTypeMap.Map1Entry: ... class Map2Entry(Message): key = ... # type: int @@ -429,7 +429,7 @@ class TestSameTypeMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestSameTypeMap.Map2Entry: ... + def FromString(cls, s: bytes) -> TestSameTypeMap.Map2Entry: ... @property def map1(self) -> MutableMapping[int, int]: ... @@ -443,7 +443,7 @@ class TestSameTypeMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestSameTypeMap: ... + def FromString(cls, s: bytes) -> TestSameTypeMap: ... class TestRequiredMessageMap(Message): @@ -461,7 +461,7 @@ class TestRequiredMessageMap(Message): @classmethod def FromString( - cls, s: str) -> TestRequiredMessageMap.MapFieldEntry: ... + cls, s: bytes) -> TestRequiredMessageMap.MapFieldEntry: ... @property def map_field(self) -> MutableMapping[int, TestRequired]: ... @@ -471,7 +471,7 @@ class TestRequiredMessageMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequiredMessageMap: ... + def FromString(cls, s: bytes) -> TestRequiredMessageMap: ... class TestArenaMap(Message): @@ -486,7 +486,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt32Int32Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32Int32Entry: ... class MapInt64Int64Entry(Message): key = ... # type: int @@ -498,7 +498,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt64Int64Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt64Int64Entry: ... class MapUint32Uint32Entry(Message): key = ... # type: int @@ -510,7 +510,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapUint32Uint32Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapUint32Uint32Entry: ... class MapUint64Uint64Entry(Message): key = ... # type: int @@ -522,7 +522,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapUint64Uint64Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapUint64Uint64Entry: ... class MapSint32Sint32Entry(Message): key = ... # type: int @@ -534,7 +534,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapSint32Sint32Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapSint32Sint32Entry: ... class MapSint64Sint64Entry(Message): key = ... # type: int @@ -546,7 +546,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapSint64Sint64Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapSint64Sint64Entry: ... class MapFixed32Fixed32Entry(Message): key = ... # type: int @@ -558,7 +558,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapFixed32Fixed32Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed32Fixed32Entry: ... class MapFixed64Fixed64Entry(Message): key = ... # type: int @@ -570,7 +570,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapFixed64Fixed64Entry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed64Fixed64Entry: ... class MapSfixed32Sfixed32Entry(Message): key = ... # type: int @@ -583,7 +583,7 @@ class TestArenaMap(Message): @classmethod def FromString( - cls, s: str) -> TestArenaMap.MapSfixed32Sfixed32Entry: ... + cls, s: bytes) -> TestArenaMap.MapSfixed32Sfixed32Entry: ... class MapSfixed64Sfixed64Entry(Message): key = ... # type: int @@ -596,7 +596,7 @@ class TestArenaMap(Message): @classmethod def FromString( - cls, s: str) -> TestArenaMap.MapSfixed64Sfixed64Entry: ... + cls, s: bytes) -> TestArenaMap.MapSfixed64Sfixed64Entry: ... class MapInt32FloatEntry(Message): key = ... # type: int @@ -608,7 +608,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt32FloatEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32FloatEntry: ... class MapInt32DoubleEntry(Message): key = ... # type: int @@ -620,7 +620,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt32DoubleEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32DoubleEntry: ... class MapBoolBoolEntry(Message): key = ... # type: bool @@ -632,7 +632,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapBoolBoolEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapBoolBoolEntry: ... class MapStringStringEntry(Message): key = ... # type: Text @@ -644,19 +644,19 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapStringStringEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapStringStringEntry: ... class MapInt32BytesEntry(Message): key = ... # type: int - value = ... # type: str + value = ... # type: bytes def __init__(self, key: Optional[int] = ..., - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt32BytesEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32BytesEntry: ... class MapInt32EnumEntry(Message): key = ... # type: int @@ -668,7 +668,7 @@ class TestArenaMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap.MapInt32EnumEntry: ... + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32EnumEntry: ... class MapInt32ForeignMessageEntry(Message): key = ... # type: int @@ -683,7 +683,7 @@ class TestArenaMap(Message): @classmethod def FromString( - cls, s: str) -> TestArenaMap.MapInt32ForeignMessageEntry: ... + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageEntry: ... class MapInt32ForeignMessageNoArenaEntry(Message): key = ... # type: int @@ -698,7 +698,7 @@ class TestArenaMap(Message): @classmethod def FromString( - cls, s: str) -> TestArenaMap.MapInt32ForeignMessageNoArenaEntry: ... + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageNoArenaEntry: ... @property def map_int32_int32(self) -> MutableMapping[int, int]: ... @@ -743,7 +743,7 @@ class TestArenaMap(Message): def map_string_string(self) -> MutableMapping[Text, Text]: ... @property - def map_int32_bytes(self) -> MutableMapping[int, str]: ... + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... @property def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... @@ -771,14 +771,14 @@ class TestArenaMap(Message): map_int32_double: Optional[Mapping[int, float]]=..., map_bool_bool: Optional[Mapping[bool, bool]]=..., map_string_string: Optional[Mapping[Text, Text]]=..., - map_int32_bytes: Optional[Mapping[int, str]]=..., + map_int32_bytes: Optional[Mapping[int, bytes]]=..., map_int32_enum: Optional[Mapping[int, MapEnum]]=..., map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]]=..., map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]]=..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestArenaMap: ... + def FromString(cls, s: bytes) -> TestArenaMap: ... class MessageContainingEnumCalledType(Message): @@ -786,19 +786,19 @@ class MessageContainingEnumCalledType(Message): class Type(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> MessageContainingEnumCalledType.Type: ... + def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[MessageContainingEnumCalledType.Type]: ... @classmethod - def items(cls) -> List[Tuple[str, + def items(cls) -> List[Tuple[bytes, MessageContainingEnumCalledType.Type]]: ... TYPE_FOO: Type @@ -815,7 +815,7 @@ class MessageContainingEnumCalledType(Message): @classmethod def FromString( - cls, s: str) -> MessageContainingEnumCalledType.TypeEntry: ... + cls, s: bytes) -> MessageContainingEnumCalledType.TypeEntry: ... @property def type(self) -> MutableMapping[Text, @@ -826,7 +826,7 @@ class MessageContainingEnumCalledType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MessageContainingEnumCalledType: ... + def FromString(cls, s: bytes) -> MessageContainingEnumCalledType: ... class MessageContainingMapCalledEntry(Message): @@ -842,7 +842,7 @@ class MessageContainingMapCalledEntry(Message): @classmethod def FromString( - cls, s: str) -> MessageContainingMapCalledEntry.EntryEntry: ... + cls, s: bytes) -> MessageContainingMapCalledEntry.EntryEntry: ... @property def entry(self) -> MutableMapping[int, int]: ... @@ -852,7 +852,7 @@ class MessageContainingMapCalledEntry(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MessageContainingMapCalledEntry: ... + def FromString(cls, s: bytes) -> MessageContainingMapCalledEntry: ... class TestRecursiveMapMessage(Message): @@ -869,7 +869,7 @@ class TestRecursiveMapMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRecursiveMapMessage.AEntry: ... + def FromString(cls, s: bytes) -> TestRecursiveMapMessage.AEntry: ... @property def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ... @@ -879,4 +879,4 @@ class TestRecursiveMapMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRecursiveMapMessage: ... + def FromString(cls, s: bytes) -> TestRecursiveMapMessage: ... diff --git a/third_party/2/google/protobuf/message.pyi b/third_party/2and3/google/protobuf/message.pyi similarity index 87% rename from third_party/2/google/protobuf/message.pyi rename to third_party/2and3/google/protobuf/message.pyi index b13821f0d..caa6ff14b 100644 --- a/third_party/2/google/protobuf/message.pyi +++ b/third_party/2and3/google/protobuf/message.pyi @@ -18,12 +18,12 @@ class Message: def IsInitialized(self) -> bool: ... def MergeFromString(self, serialized: Any) -> int: ... # TODO: we need to be able to call buffer() on serialized def ParseFromString(self, serialized: Any) -> None: ... - def SerializeToString(self) -> str: ... - def SerializePartialToString(self) -> str: ... + def SerializeToString(self) -> bytes: ... + def SerializePartialToString(self) -> bytes: ... def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ... def HasField(self, field_name: Text) -> bool: ... def ClearField(self, field_name: Text) -> None: ... - def WhichOneof(self, oneof_group) -> Optional[str]: ... + def WhichOneof(self, oneof_group) -> Optional[bytes]: ... def HasExtension(self, extension_handle): ... def ClearExtension(self, extension_handle): ... def ByteSize(self) -> int: ... diff --git a/third_party/2/google/protobuf/message_factory.pyi b/third_party/2and3/google/protobuf/message_factory.pyi similarity index 71% rename from third_party/2/google/protobuf/message_factory.pyi rename to third_party/2and3/google/protobuf/message_factory.pyi index fc26f2cd6..c51c1364b 100644 --- a/third_party/2/google/protobuf/message_factory.pyi +++ b/third_party/2and3/google/protobuf/message_factory.pyi @@ -8,6 +8,6 @@ class MessageFactory: pool = ... # type: Any def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ... def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ... - def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... -def GetMessages(file_protos: Iterable[str]) -> Dict[str, Type[Message]]: ... +def GetMessages(file_protos: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... diff --git a/third_party/2/google/protobuf/reflection.pyi b/third_party/2and3/google/protobuf/reflection.pyi similarity index 100% rename from third_party/2/google/protobuf/reflection.pyi rename to third_party/2and3/google/protobuf/reflection.pyi diff --git a/third_party/2/google/protobuf/source_context_pb2.pyi b/third_party/2and3/google/protobuf/source_context_pb2.pyi similarity index 83% rename from third_party/2/google/protobuf/source_context_pb2.pyi rename to third_party/2and3/google/protobuf/source_context_pb2.pyi index 7411fdf2e..7c2575730 100644 --- a/third_party/2/google/protobuf/source_context_pb2.pyi +++ b/third_party/2and3/google/protobuf/source_context_pb2.pyi @@ -15,4 +15,4 @@ class SourceContext(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SourceContext: ... + def FromString(cls, s: bytes) -> SourceContext: ... diff --git a/third_party/2/google/protobuf/struct_pb2.pyi b/third_party/2and3/google/protobuf/struct_pb2.pyi similarity index 83% rename from third_party/2/google/protobuf/struct_pb2.pyi rename to third_party/2and3/google/protobuf/struct_pb2.pyi index 0424cb891..01a3a67a1 100644 --- a/third_party/2/google/protobuf/struct_pb2.pyi +++ b/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -20,19 +20,19 @@ from typing import ( class NullValue(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> NullValue: ... + def Value(cls, name: bytes) -> NullValue: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[NullValue]: ... @classmethod - def items(cls) -> List[Tuple[str, NullValue]]: ... + def items(cls) -> List[Tuple[bytes, NullValue]]: ... NULL_VALUE: NullValue @@ -51,7 +51,7 @@ class Struct(Message, well_known_types.Struct): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Struct.FieldsEntry: ... + def FromString(cls, s: bytes) -> Struct.FieldsEntry: ... @property def fields(self) -> MutableMapping[Text, Value]: ... @@ -61,7 +61,7 @@ class Struct(Message, well_known_types.Struct): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Struct: ... + def FromString(cls, s: bytes) -> Struct: ... class _Value(Message): @@ -86,7 +86,7 @@ class _Value(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> _Value: ... + def FromString(cls, s: bytes) -> _Value: ... Value = _Value @@ -102,4 +102,4 @@ class ListValue(Message, well_known_types.ListValue): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ListValue: ... + def FromString(cls, s: bytes) -> ListValue: ... diff --git a/third_party/2/google/protobuf/symbol_database.pyi b/third_party/2and3/google/protobuf/symbol_database.pyi similarity index 77% rename from third_party/2/google/protobuf/symbol_database.pyi rename to third_party/2and3/google/protobuf/symbol_database.pyi index df8300f50..477d80e9f 100644 --- a/third_party/2/google/protobuf/symbol_database.pyi +++ b/third_party/2and3/google/protobuf/symbol_database.pyi @@ -8,7 +8,7 @@ class SymbolDatabase(MessageFactory): def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ... def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ... def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ... - def GetSymbol(self, symbol: str) -> Type[Message]: ... - def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ... + def GetSymbol(self, symbol: bytes) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... def Default(): ... diff --git a/third_party/2/google/protobuf/test_messages_proto2_pb2.pyi b/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi similarity index 86% rename from third_party/2/google/protobuf/test_messages_proto2_pb2.pyi rename to third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi index bbf14e132..1dd097f0b 100644 --- a/third_party/2/google/protobuf/test_messages_proto2_pb2.pyi +++ b/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi @@ -21,19 +21,19 @@ from typing import ( class ForeignEnumProto2(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ForeignEnumProto2: ... + def Value(cls, name: bytes) -> ForeignEnumProto2: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ForeignEnumProto2]: ... @classmethod - def items(cls) -> List[Tuple[str, ForeignEnumProto2]]: ... + def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ... FOREIGN_FOO: ForeignEnumProto2 @@ -46,19 +46,19 @@ class TestAllTypesProto2(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestAllTypesProto2.NestedEnum: ... + def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestAllTypesProto2.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ... FOO: NestedEnum BAR: NestedEnum BAZ: NestedEnum @@ -76,7 +76,7 @@ class TestAllTypesProto2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto2.NestedMessage: ... + def FromString(cls, s: bytes) -> TestAllTypesProto2.NestedMessage: ... class MapInt32Int32Entry(Message): key = ... # type: int @@ -89,7 +89,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapInt32Int32Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapInt32Int32Entry: ... class MapInt64Int64Entry(Message): key = ... # type: int @@ -102,7 +102,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapInt64Int64Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapInt64Int64Entry: ... class MapUint32Uint32Entry(Message): key = ... # type: int @@ -115,7 +115,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapUint32Uint32Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapUint32Uint32Entry: ... class MapUint64Uint64Entry(Message): key = ... # type: int @@ -128,7 +128,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapUint64Uint64Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapUint64Uint64Entry: ... class MapSint32Sint32Entry(Message): key = ... # type: int @@ -141,7 +141,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapSint32Sint32Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapSint32Sint32Entry: ... class MapSint64Sint64Entry(Message): key = ... # type: int @@ -154,7 +154,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapSint64Sint64Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapSint64Sint64Entry: ... class MapFixed32Fixed32Entry(Message): key = ... # type: int @@ -167,7 +167,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapFixed32Fixed32Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapFixed32Fixed32Entry: ... class MapFixed64Fixed64Entry(Message): key = ... # type: int @@ -180,7 +180,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapFixed64Fixed64Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapFixed64Fixed64Entry: ... class MapSfixed32Sfixed32Entry(Message): key = ... # type: int @@ -193,7 +193,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapSfixed32Sfixed32Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapSfixed32Sfixed32Entry: ... class MapSfixed64Sfixed64Entry(Message): key = ... # type: int @@ -206,7 +206,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapSfixed64Sfixed64Entry: ... + cls, s: bytes) -> TestAllTypesProto2.MapSfixed64Sfixed64Entry: ... class MapInt32FloatEntry(Message): key = ... # type: int @@ -219,7 +219,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapInt32FloatEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapInt32FloatEntry: ... class MapInt32DoubleEntry(Message): key = ... # type: int @@ -232,7 +232,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapInt32DoubleEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapInt32DoubleEntry: ... class MapBoolBoolEntry(Message): key = ... # type: bool @@ -244,7 +244,7 @@ class TestAllTypesProto2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto2.MapBoolBoolEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto2.MapBoolBoolEntry: ... class MapStringStringEntry(Message): key = ... # type: Text @@ -257,20 +257,20 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringStringEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringStringEntry: ... class MapStringBytesEntry(Message): key = ... # type: Text - value = ... # type: str + value = ... # type: bytes def __init__(self, key: Optional[Text] = ..., - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringBytesEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringBytesEntry: ... class MapStringNestedMessageEntry(Message): key = ... # type: Text @@ -285,7 +285,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringNestedMessageEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedMessageEntry: ... class MapStringForeignMessageEntry(Message): key = ... # type: Text @@ -300,7 +300,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringForeignMessageEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignMessageEntry: ... class MapStringNestedEnumEntry(Message): key = ... # type: Text @@ -313,7 +313,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringNestedEnumEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedEnumEntry: ... class MapStringForeignEnumEntry(Message): key = ... # type: Text @@ -326,7 +326,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MapStringForeignEnumEntry: ... + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignEnumEntry: ... class Data(Message): group_int32 = ... # type: int @@ -338,7 +338,7 @@ class TestAllTypesProto2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto2.Data: ... + def FromString(cls, s: bytes) -> TestAllTypesProto2.Data: ... class MessageSetCorrect(Message): @@ -347,18 +347,18 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MessageSetCorrect: ... + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrect: ... class MessageSetCorrectExtension1(Message): - str = ... # type: Text + bytes = ... # type: Text def __init__(self, - str: Optional[Text] = ..., + bytes: Optional[Text] = ..., ) -> None: ... @classmethod def FromString( - cls, s: builtins.str) -> TestAllTypesProto2.MessageSetCorrectExtension1: ... + cls, s: builtins.bytes) -> TestAllTypesProto2.MessageSetCorrectExtension1: ... class MessageSetCorrectExtension2(Message): i = ... # type: int @@ -369,7 +369,7 @@ class TestAllTypesProto2(Message): @classmethod def FromString( - cls, s: str) -> TestAllTypesProto2.MessageSetCorrectExtension2: ... + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrectExtension2: ... optional_int32 = ... # type: int optional_int64 = ... # type: int optional_uint32 = ... # type: int @@ -384,7 +384,7 @@ class TestAllTypesProto2(Message): optional_double = ... # type: float optional_bool = ... # type: bool optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes optional_nested_enum = ... # type: TestAllTypesProto2.NestedEnum optional_foreign_enum = ... # type: ForeignEnumProto2 optional_string_piece = ... # type: Text @@ -403,14 +403,14 @@ class TestAllTypesProto2(Message): repeated_double = ... # type: RepeatedScalarFieldContainer[float] repeated_bool = ... # type: RepeatedScalarFieldContainer[bool] repeated_string = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes = ... # type: RepeatedScalarFieldContainer[bytes] repeated_nested_enum = ... # type: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum] repeated_foreign_enum = ... # type: RepeatedScalarFieldContainer[ForeignEnumProto2] repeated_string_piece = ... # type: RepeatedScalarFieldContainer[Text] repeated_cord = ... # type: RepeatedScalarFieldContainer[Text] oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes oneof_bool = ... # type: bool oneof_uint64 = ... # type: int oneof_float = ... # type: float @@ -495,7 +495,7 @@ class TestAllTypesProto2(Message): def map_string_string(self) -> MutableMapping[Text, Text]: ... @property - def map_string_bytes(self) -> MutableMapping[Text, str]: ... + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... @property def map_string_nested_message( @@ -534,7 +534,7 @@ class TestAllTypesProto2(Message): optional_double: Optional[float] = ..., optional_bool: Optional[bool] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., optional_foreign_message: Optional[ForeignMessageProto2] = ..., optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., @@ -556,7 +556,7 @@ class TestAllTypesProto2(Message): repeated_double: Optional[Iterable[float]] = ..., repeated_bool: Optional[Iterable[bool]] = ..., repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[str]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ..., repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ..., repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ..., @@ -577,7 +577,7 @@ class TestAllTypesProto2(Message): map_int32_double: Optional[Mapping[int, float]]=..., map_bool_bool: Optional[Mapping[bool, bool]]=..., map_string_string: Optional[Mapping[Text, Text]]=..., - map_string_bytes: Optional[Mapping[Text, str]]=..., + map_string_bytes: Optional[Mapping[Text, bytes]]=..., map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]]=..., map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]]=..., map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]]=..., @@ -585,7 +585,7 @@ class TestAllTypesProto2(Message): oneof_uint32: Optional[int] = ..., oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., oneof_bool: Optional[bool] = ..., oneof_uint64: Optional[int] = ..., oneof_float: Optional[float] = ..., @@ -613,7 +613,7 @@ class TestAllTypesProto2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto2: ... + def FromString(cls, s: bytes) -> TestAllTypesProto2: ... class ForeignMessageProto2(Message): @@ -624,4 +624,4 @@ class ForeignMessageProto2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ForeignMessageProto2: ... + def FromString(cls, s: bytes) -> ForeignMessageProto2: ... diff --git a/third_party/2/google/protobuf/test_messages_proto3_pb2.pyi b/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi similarity index 88% rename from third_party/2/google/protobuf/test_messages_proto3_pb2.pyi rename to third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi index 932253964..2389a2c38 100644 --- a/third_party/2/google/protobuf/test_messages_proto3_pb2.pyi +++ b/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi @@ -47,19 +47,19 @@ from typing import ( class ForeignEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ForeignEnum: ... + def Value(cls, name: bytes) -> ForeignEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ForeignEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, ForeignEnum]]: ... + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... FOREIGN_FOO: ForeignEnum FOREIGN_BAR: ForeignEnum FOREIGN_BAZ: ForeignEnum @@ -70,19 +70,19 @@ class TestAllTypesProto3(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestAllTypesProto3.NestedEnum: ... + def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestAllTypesProto3.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ... FOO: NestedEnum BAR: NestedEnum BAZ: NestedEnum @@ -100,7 +100,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.NestedMessage: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.NestedMessage: ... class MapInt32Int32Entry(Message): key = ... # type: int @@ -112,7 +112,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapInt32Int32Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32Int32Entry: ... class MapInt64Int64Entry(Message): key = ... # type: int @@ -124,7 +124,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapInt64Int64Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt64Int64Entry: ... class MapUint32Uint32Entry(Message): key = ... # type: int @@ -136,7 +136,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapUint32Uint32Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint32Uint32Entry: ... class MapUint64Uint64Entry(Message): key = ... # type: int @@ -148,7 +148,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapUint64Uint64Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint64Uint64Entry: ... class MapSint32Sint32Entry(Message): key = ... # type: int @@ -160,7 +160,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapSint32Sint32Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint32Sint32Entry: ... class MapSint64Sint64Entry(Message): key = ... # type: int @@ -172,7 +172,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapSint64Sint64Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint64Sint64Entry: ... class MapFixed32Fixed32Entry(Message): key = ... # type: int @@ -184,7 +184,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapFixed32Fixed32Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed32Fixed32Entry: ... class MapFixed64Fixed64Entry(Message): key = ... # type: int @@ -196,7 +196,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapFixed64Fixed64Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed64Fixed64Entry: ... class MapSfixed32Sfixed32Entry(Message): key = ... # type: int @@ -208,7 +208,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapSfixed32Sfixed32Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed32Sfixed32Entry: ... class MapSfixed64Sfixed64Entry(Message): key = ... # type: int @@ -220,7 +220,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapSfixed64Sfixed64Entry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed64Sfixed64Entry: ... class MapInt32FloatEntry(Message): key = ... # type: int @@ -232,7 +232,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapInt32FloatEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32FloatEntry: ... class MapInt32DoubleEntry(Message): key = ... # type: int @@ -244,7 +244,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapInt32DoubleEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32DoubleEntry: ... class MapBoolBoolEntry(Message): key = ... # type: bool @@ -256,7 +256,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapBoolBoolEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapBoolBoolEntry: ... class MapStringStringEntry(Message): key = ... # type: Text @@ -268,19 +268,19 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringStringEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringStringEntry: ... class MapStringBytesEntry(Message): key = ... # type: Text - value = ... # type: str + value = ... # type: bytes def __init__(self, key: Optional[Text] = ..., - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringBytesEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringBytesEntry: ... class MapStringNestedMessageEntry(Message): key = ... # type: Text @@ -294,7 +294,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringNestedMessageEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedMessageEntry: ... class MapStringForeignMessageEntry(Message): key = ... # type: Text @@ -308,7 +308,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringForeignMessageEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignMessageEntry: ... class MapStringNestedEnumEntry(Message): key = ... # type: Text @@ -320,7 +320,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringNestedEnumEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedEnumEntry: ... class MapStringForeignEnumEntry(Message): key = ... # type: Text @@ -332,7 +332,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3.MapStringForeignEnumEntry: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignEnumEntry: ... optional_int32 = ... # type: int optional_int64 = ... # type: int optional_uint32 = ... # type: int @@ -347,7 +347,7 @@ class TestAllTypesProto3(Message): optional_double = ... # type: float optional_bool = ... # type: bool optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes optional_nested_enum = ... # type: TestAllTypesProto3.NestedEnum optional_foreign_enum = ... # type: ForeignEnum optional_string_piece = ... # type: Text @@ -366,14 +366,14 @@ class TestAllTypesProto3(Message): repeated_double = ... # type: RepeatedScalarFieldContainer[float] repeated_bool = ... # type: RepeatedScalarFieldContainer[bool] repeated_string = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes = ... # type: RepeatedScalarFieldContainer[bytes] repeated_nested_enum = ... # type: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum] repeated_foreign_enum = ... # type: RepeatedScalarFieldContainer[ForeignEnum] repeated_string_piece = ... # type: RepeatedScalarFieldContainer[Text] repeated_cord = ... # type: RepeatedScalarFieldContainer[Text] oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes oneof_bool = ... # type: bool oneof_uint64 = ... # type: int oneof_float = ... # type: float @@ -456,7 +456,7 @@ class TestAllTypesProto3(Message): def map_string_string(self) -> MutableMapping[Text, Text]: ... @property - def map_string_bytes(self) -> MutableMapping[Text, str]: ... + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... @property def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ... @@ -578,7 +578,7 @@ class TestAllTypesProto3(Message): optional_double: Optional[float] = ..., optional_bool: Optional[bool] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., optional_foreign_message: Optional[ForeignMessage] = ..., optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., @@ -600,7 +600,7 @@ class TestAllTypesProto3(Message): repeated_double: Optional[Iterable[float]] = ..., repeated_bool: Optional[Iterable[bool]] = ..., repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[str]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ..., repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ..., @@ -621,7 +621,7 @@ class TestAllTypesProto3(Message): map_int32_double: Optional[Mapping[int, float]]=..., map_bool_bool: Optional[Mapping[bool, bool]]=..., map_string_string: Optional[Mapping[Text, Text]]=..., - map_string_bytes: Optional[Mapping[Text, str]]=..., + map_string_bytes: Optional[Mapping[Text, bytes]]=..., map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]]=..., map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]]=..., map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]]=..., @@ -629,7 +629,7 @@ class TestAllTypesProto3(Message): oneof_uint32: Optional[int] = ..., oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., oneof_bool: Optional[bool] = ..., oneof_uint64: Optional[int] = ..., oneof_float: Optional[float] = ..., @@ -686,7 +686,7 @@ class TestAllTypesProto3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypesProto3: ... + def FromString(cls, s: bytes) -> TestAllTypesProto3: ... class ForeignMessage(Message): @@ -697,4 +697,4 @@ class ForeignMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ForeignMessage: ... + def FromString(cls, s: bytes) -> ForeignMessage: ... diff --git a/third_party/2/google/protobuf/timestamp_pb2.pyi b/third_party/2and3/google/protobuf/timestamp_pb2.pyi similarity index 89% rename from third_party/2/google/protobuf/timestamp_pb2.pyi rename to third_party/2and3/google/protobuf/timestamp_pb2.pyi index 2482864f0..a037d0f84 100644 --- a/third_party/2/google/protobuf/timestamp_pb2.pyi +++ b/third_party/2and3/google/protobuf/timestamp_pb2.pyi @@ -18,4 +18,4 @@ class Timestamp(Message, well_known_types.Timestamp): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Timestamp: ... + def FromString(cls, s: bytes) -> Timestamp: ... diff --git a/third_party/2/google/protobuf/type_pb2.pyi b/third_party/2and3/google/protobuf/type_pb2.pyi similarity index 84% rename from third_party/2/google/protobuf/type_pb2.pyi rename to third_party/2and3/google/protobuf/type_pb2.pyi index 61c46d7c6..86e8dc0fe 100644 --- a/third_party/2/google/protobuf/type_pb2.pyi +++ b/third_party/2and3/google/protobuf/type_pb2.pyi @@ -24,19 +24,19 @@ from typing import ( class Syntax(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> Syntax: ... + def Value(cls, name: bytes) -> Syntax: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[Syntax]: ... @classmethod - def items(cls) -> List[Tuple[str, Syntax]]: ... + def items(cls) -> List[Tuple[bytes, Syntax]]: ... SYNTAX_PROTO2: Syntax @@ -67,7 +67,7 @@ class Type(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Type: ... + def FromString(cls, s: bytes) -> Type: ... class Field(Message): @@ -75,19 +75,19 @@ class Field(Message): class Kind(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> Field.Kind: ... + def Value(cls, name: bytes) -> Field.Kind: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[Field.Kind]: ... @classmethod - def items(cls) -> List[Tuple[str, Field.Kind]]: ... + def items(cls) -> List[Tuple[bytes, Field.Kind]]: ... TYPE_UNKNOWN: Kind TYPE_DOUBLE: Kind TYPE_FLOAT: Kind @@ -111,19 +111,19 @@ class Field(Message): class Cardinality(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> Field.Cardinality: ... + def Value(cls, name: bytes) -> Field.Cardinality: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[Field.Cardinality]: ... @classmethod - def items(cls) -> List[Tuple[str, Field.Cardinality]]: ... + def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ... CARDINALITY_UNKNOWN: Cardinality CARDINALITY_OPTIONAL: Cardinality CARDINALITY_REQUIRED: Cardinality @@ -155,7 +155,7 @@ class Field(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Field: ... + def FromString(cls, s: bytes) -> Field: ... class Enum(Message): @@ -180,7 +180,7 @@ class Enum(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Enum: ... + def FromString(cls, s: bytes) -> Enum: ... class EnumValue(Message): @@ -197,7 +197,7 @@ class EnumValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> EnumValue: ... + def FromString(cls, s: bytes) -> EnumValue: ... class Option(Message): @@ -212,4 +212,4 @@ class Option(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Option: ... + def FromString(cls, s: bytes) -> Option: ... diff --git a/third_party/2/google/protobuf/unittest_arena_pb2.pyi b/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi similarity index 90% rename from third_party/2/google/protobuf/unittest_arena_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_arena_pb2.pyi index 9fca5932d..ba6a31703 100644 --- a/third_party/2/google/protobuf/unittest_arena_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi @@ -21,7 +21,7 @@ class NestedMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> NestedMessage: ... + def FromString(cls, s: bytes) -> NestedMessage: ... class ArenaMessage(Message): @@ -40,4 +40,4 @@ class ArenaMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ArenaMessage: ... + def FromString(cls, s: bytes) -> ArenaMessage: ... diff --git a/third_party/2/google/protobuf/unittest_custom_options_pb2.pyi b/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi similarity index 70% rename from third_party/2/google/protobuf/unittest_custom_options_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi index 2216a902a..25c779fe4 100644 --- a/third_party/2/google/protobuf/unittest_custom_options_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi @@ -21,19 +21,19 @@ from typing import ( class MethodOpt1(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> MethodOpt1: ... + def Value(cls, name: bytes) -> MethodOpt1: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[MethodOpt1]: ... @classmethod - def items(cls) -> List[Tuple[str, MethodOpt1]]: ... + def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ... METHODOPT1_VAL1: MethodOpt1 @@ -43,19 +43,19 @@ METHODOPT1_VAL2: MethodOpt1 class AggregateEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> AggregateEnum: ... + def Value(cls, name: bytes) -> AggregateEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[AggregateEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, AggregateEnum]]: ... + def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ... VALUE: AggregateEnum @@ -66,19 +66,19 @@ class TestMessageWithCustomOptions(Message): class AnEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestMessageWithCustomOptions.AnEnum: ... + def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, + def items(cls) -> List[Tuple[bytes, TestMessageWithCustomOptions.AnEnum]]: ... ANENUM_VAL1: AnEnum ANENUM_VAL2: AnEnum @@ -91,7 +91,7 @@ class TestMessageWithCustomOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageWithCustomOptions: ... + def FromString(cls, s: bytes) -> TestMessageWithCustomOptions: ... class CustomOptionFooRequest(Message): @@ -100,7 +100,7 @@ class CustomOptionFooRequest(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionFooRequest: ... + def FromString(cls, s: bytes) -> CustomOptionFooRequest: ... class CustomOptionFooResponse(Message): @@ -109,7 +109,7 @@ class CustomOptionFooResponse(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionFooResponse: ... + def FromString(cls, s: bytes) -> CustomOptionFooResponse: ... class CustomOptionFooClientMessage(Message): @@ -118,7 +118,7 @@ class CustomOptionFooClientMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionFooClientMessage: ... + def FromString(cls, s: bytes) -> CustomOptionFooClientMessage: ... class CustomOptionFooServerMessage(Message): @@ -127,7 +127,7 @@ class CustomOptionFooServerMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionFooServerMessage: ... + def FromString(cls, s: bytes) -> CustomOptionFooServerMessage: ... class DummyMessageContainingEnum(Message): @@ -135,19 +135,19 @@ class DummyMessageContainingEnum(Message): class TestEnumType(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> DummyMessageContainingEnum.TestEnumType: ... + def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ... @classmethod - def items(cls) -> List[Tuple[str, + def items(cls) -> List[Tuple[bytes, DummyMessageContainingEnum.TestEnumType]]: ... TEST_OPTION_ENUM_TYPE1: TestEnumType TEST_OPTION_ENUM_TYPE2: TestEnumType @@ -156,7 +156,7 @@ class DummyMessageContainingEnum(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DummyMessageContainingEnum: ... + def FromString(cls, s: bytes) -> DummyMessageContainingEnum: ... class DummyMessageInvalidAsOptionType(Message): @@ -165,7 +165,7 @@ class DummyMessageInvalidAsOptionType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DummyMessageInvalidAsOptionType: ... + def FromString(cls, s: bytes) -> DummyMessageInvalidAsOptionType: ... class CustomOptionMinIntegerValues(Message): @@ -174,7 +174,7 @@ class CustomOptionMinIntegerValues(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionMinIntegerValues: ... + def FromString(cls, s: bytes) -> CustomOptionMinIntegerValues: ... class CustomOptionMaxIntegerValues(Message): @@ -183,7 +183,7 @@ class CustomOptionMaxIntegerValues(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionMaxIntegerValues: ... + def FromString(cls, s: bytes) -> CustomOptionMaxIntegerValues: ... class CustomOptionOtherValues(Message): @@ -192,7 +192,7 @@ class CustomOptionOtherValues(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> CustomOptionOtherValues: ... + def FromString(cls, s: bytes) -> CustomOptionOtherValues: ... class SettingRealsFromPositiveInts(Message): @@ -201,7 +201,7 @@ class SettingRealsFromPositiveInts(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SettingRealsFromPositiveInts: ... + def FromString(cls, s: bytes) -> SettingRealsFromPositiveInts: ... class SettingRealsFromNegativeInts(Message): @@ -210,7 +210,7 @@ class SettingRealsFromNegativeInts(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SettingRealsFromNegativeInts: ... + def FromString(cls, s: bytes) -> SettingRealsFromNegativeInts: ... class ComplexOptionType1(Message): @@ -227,7 +227,7 @@ class ComplexOptionType1(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ComplexOptionType1: ... + def FromString(cls, s: bytes) -> ComplexOptionType1: ... class ComplexOptionType2(Message): @@ -241,7 +241,7 @@ class ComplexOptionType2(Message): @classmethod def FromString( - cls, s: str) -> ComplexOptionType2.ComplexOptionType4: ... + cls, s: bytes) -> ComplexOptionType2.ComplexOptionType4: ... baz = ... # type: int @property @@ -262,7 +262,7 @@ class ComplexOptionType2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ComplexOptionType2: ... + def FromString(cls, s: bytes) -> ComplexOptionType2: ... class ComplexOptionType3(Message): @@ -276,7 +276,7 @@ class ComplexOptionType3(Message): @classmethod def FromString( - cls, s: str) -> ComplexOptionType3.ComplexOptionType5: ... + cls, s: bytes) -> ComplexOptionType3.ComplexOptionType5: ... qux = ... # type: int @property @@ -288,7 +288,7 @@ class ComplexOptionType3(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ComplexOptionType3: ... + def FromString(cls, s: bytes) -> ComplexOptionType3: ... class ComplexOpt6(Message): @@ -299,7 +299,7 @@ class ComplexOpt6(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ComplexOpt6: ... + def FromString(cls, s: bytes) -> ComplexOpt6: ... class VariousComplexOptions(Message): @@ -308,7 +308,7 @@ class VariousComplexOptions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> VariousComplexOptions: ... + def FromString(cls, s: bytes) -> VariousComplexOptions: ... class AggregateMessageSet(Message): @@ -317,7 +317,7 @@ class AggregateMessageSet(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> AggregateMessageSet: ... + def FromString(cls, s: bytes) -> AggregateMessageSet: ... class AggregateMessageSetElement(Message): @@ -328,7 +328,7 @@ class AggregateMessageSetElement(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> AggregateMessageSetElement: ... + def FromString(cls, s: bytes) -> AggregateMessageSetElement: ... class Aggregate(Message): @@ -353,7 +353,7 @@ class Aggregate(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Aggregate: ... + def FromString(cls, s: bytes) -> Aggregate: ... class AggregateMessage(Message): @@ -364,7 +364,7 @@ class AggregateMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> AggregateMessage: ... + def FromString(cls, s: bytes) -> AggregateMessage: ... class NestedOptionType(Message): @@ -372,19 +372,19 @@ class NestedOptionType(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> NestedOptionType.NestedEnum: ... + def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[NestedOptionType.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, NestedOptionType.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ... NESTED_ENUM_VALUE: NestedEnum class NestedMessage(Message): @@ -395,13 +395,13 @@ class NestedOptionType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> NestedOptionType.NestedMessage: ... + def FromString(cls, s: bytes) -> NestedOptionType.NestedMessage: ... def __init__(self, ) -> None: ... @classmethod - def FromString(cls, s: str) -> NestedOptionType: ... + def FromString(cls, s: bytes) -> NestedOptionType: ... class OldOptionType(Message): @@ -409,19 +409,19 @@ class OldOptionType(Message): class TestEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> OldOptionType.TestEnum: ... + def Value(cls, name: bytes) -> OldOptionType.TestEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[OldOptionType.TestEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, OldOptionType.TestEnum]]: ... + def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ... OLD_VALUE: TestEnum value = ... # type: OldOptionType.TestEnum @@ -430,7 +430,7 @@ class OldOptionType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> OldOptionType: ... + def FromString(cls, s: bytes) -> OldOptionType: ... class NewOptionType(Message): @@ -438,19 +438,19 @@ class NewOptionType(Message): class TestEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> NewOptionType.TestEnum: ... + def Value(cls, name: bytes) -> NewOptionType.TestEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[NewOptionType.TestEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, NewOptionType.TestEnum]]: ... + def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ... OLD_VALUE: TestEnum NEW_VALUE: TestEnum value = ... # type: NewOptionType.TestEnum @@ -460,7 +460,7 @@ class NewOptionType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> NewOptionType: ... + def FromString(cls, s: bytes) -> NewOptionType: ... class TestMessageWithRequiredEnumOption(Message): @@ -469,4 +469,4 @@ class TestMessageWithRequiredEnumOption(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageWithRequiredEnumOption: ... + def FromString(cls, s: bytes) -> TestMessageWithRequiredEnumOption: ... diff --git a/third_party/2/google/protobuf/unittest_import_pb2.pyi b/third_party/2and3/google/protobuf/unittest_import_pb2.pyi similarity index 62% rename from third_party/2/google/protobuf/unittest_import_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_import_pb2.pyi index cdd97d871..cc5e71047 100644 --- a/third_party/2/google/protobuf/unittest_import_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_import_pb2.pyi @@ -12,19 +12,19 @@ from typing import ( class ImportEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ImportEnum: ... + def Value(cls, name: bytes) -> ImportEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ImportEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, ImportEnum]]: ... + def items(cls) -> List[Tuple[bytes, ImportEnum]]: ... IMPORT_FOO: ImportEnum @@ -35,19 +35,19 @@ IMPORT_BAZ: ImportEnum class ImportEnumForMap(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ImportEnumForMap: ... + def Value(cls, name: bytes) -> ImportEnumForMap: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ImportEnumForMap]: ... @classmethod - def items(cls) -> List[Tuple[str, ImportEnumForMap]]: ... + def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ... UNKNOWN: ImportEnumForMap @@ -63,4 +63,4 @@ class ImportMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ImportMessage: ... + def FromString(cls, s: bytes) -> ImportMessage: ... diff --git a/third_party/2/google/protobuf/unittest_import_public_pb2.pyi b/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi similarity index 81% rename from third_party/2/google/protobuf/unittest_import_public_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi index 30cf48d91..2ea64454d 100644 --- a/third_party/2/google/protobuf/unittest_import_public_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi @@ -14,4 +14,4 @@ class PublicImportMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> PublicImportMessage: ... + def FromString(cls, s: bytes) -> PublicImportMessage: ... diff --git a/third_party/2/google/protobuf/unittest_mset_pb2.pyi b/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi similarity index 74% rename from third_party/2/google/protobuf/unittest_mset_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_mset_pb2.pyi index a6a3b0eff..9ca738e56 100644 --- a/third_party/2/google/protobuf/unittest_mset_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi @@ -25,7 +25,7 @@ class TestMessageSetContainer(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageSetContainer: ... + def FromString(cls, s: bytes) -> TestMessageSetContainer: ... class TestMessageSetExtension1(Message): @@ -36,33 +36,33 @@ class TestMessageSetExtension1(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageSetExtension1: ... + def FromString(cls, s: bytes) -> TestMessageSetExtension1: ... class TestMessageSetExtension2(Message): str = ... # type: Text def __init__(self, - str: Optional[Text] = ..., + bytes: Optional[Text] = ..., ) -> None: ... @classmethod - def FromString(cls, s: builtins.str) -> TestMessageSetExtension2: ... + def FromString(cls, s: builtins.bytes) -> TestMessageSetExtension2: ... class RawMessageSet(Message): class Item(Message): type_id = ... # type: int - message = ... # type: str + message = ... # type: bytes def __init__(self, type_id: int, - message: str, + message: bytes, ) -> None: ... @classmethod - def FromString(cls, s: str) -> RawMessageSet.Item: ... + def FromString(cls, s: bytes) -> RawMessageSet.Item: ... @property def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ... @@ -72,4 +72,4 @@ class RawMessageSet(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> RawMessageSet: ... + def FromString(cls, s: bytes) -> RawMessageSet: ... diff --git a/third_party/2/google/protobuf/unittest_mset_wire_format_pb2.pyi b/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi similarity index 77% rename from third_party/2/google/protobuf/unittest_mset_wire_format_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi index 95cfda4a2..acb24a46f 100644 --- a/third_party/2/google/protobuf/unittest_mset_wire_format_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi @@ -12,7 +12,7 @@ class TestMessageSet(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageSet: ... + def FromString(cls, s: bytes) -> TestMessageSet: ... class TestMessageSetWireFormatContainer(Message): @@ -25,4 +25,4 @@ class TestMessageSetWireFormatContainer(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessageSetWireFormatContainer: ... + def FromString(cls, s: bytes) -> TestMessageSetWireFormatContainer: ... diff --git a/third_party/2/google/protobuf/unittest_no_arena_import_pb2.pyi b/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi similarity index 79% rename from third_party/2/google/protobuf/unittest_no_arena_import_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi index 8870d98a2..bbe40511a 100644 --- a/third_party/2/google/protobuf/unittest_no_arena_import_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi @@ -14,4 +14,4 @@ class ImportNoArenaNestedMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ImportNoArenaNestedMessage: ... + def FromString(cls, s: bytes) -> ImportNoArenaNestedMessage: ... diff --git a/third_party/2/google/protobuf/unittest_no_arena_pb2.pyi b/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi similarity index 90% rename from third_party/2/google/protobuf/unittest_no_arena_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi index ee03ad0cf..bae53f08d 100644 --- a/third_party/2/google/protobuf/unittest_no_arena_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi @@ -28,19 +28,19 @@ from typing import ( class ForeignEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ForeignEnum: ... + def Value(cls, name: bytes) -> ForeignEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ForeignEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, ForeignEnum]]: ... + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... FOREIGN_FOO: ForeignEnum @@ -53,19 +53,19 @@ class TestAllTypes(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestAllTypes.NestedEnum: ... + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestAllTypes.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestAllTypes.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... FOO: NestedEnum BAR: NestedEnum BAZ: NestedEnum @@ -79,7 +79,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.NestedMessage: ... + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... class OptionalGroup(Message): a = ... # type: int @@ -89,7 +89,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.OptionalGroup: ... + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... class RepeatedGroup(Message): a = ... # type: int @@ -99,7 +99,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.RepeatedGroup: ... + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... optional_int32 = ... # type: int optional_int64 = ... # type: int optional_uint32 = ... # type: int @@ -114,7 +114,7 @@ class TestAllTypes(Message): optional_double = ... # type: float optional_bool = ... # type: bool optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes optional_nested_enum = ... # type: TestAllTypes.NestedEnum optional_foreign_enum = ... # type: ForeignEnum optional_import_enum = ... # type: ImportEnum @@ -134,7 +134,7 @@ class TestAllTypes(Message): repeated_double = ... # type: RepeatedScalarFieldContainer[float] repeated_bool = ... # type: RepeatedScalarFieldContainer[bool] repeated_string = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes = ... # type: RepeatedScalarFieldContainer[bytes] repeated_nested_enum = ... # type: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] repeated_foreign_enum = ... # type: RepeatedScalarFieldContainer[ForeignEnum] repeated_import_enum = ... # type: RepeatedScalarFieldContainer[ImportEnum] @@ -154,7 +154,7 @@ class TestAllTypes(Message): default_double = ... # type: float default_bool = ... # type: bool default_string = ... # type: Text - default_bytes = ... # type: str + default_bytes = ... # type: bytes default_nested_enum = ... # type: TestAllTypes.NestedEnum default_foreign_enum = ... # type: ForeignEnum default_import_enum = ... # type: ImportEnum @@ -162,7 +162,7 @@ class TestAllTypes(Message): default_cord = ... # type: Text oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes @property def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... @@ -223,7 +223,7 @@ class TestAllTypes(Message): optional_double: Optional[float] = ..., optional_bool: Optional[bool] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., optional_foreign_message: Optional[ForeignMessage] = ..., @@ -249,7 +249,7 @@ class TestAllTypes(Message): repeated_double: Optional[Iterable[float]] = ..., repeated_bool: Optional[Iterable[bool]] = ..., repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[str]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., @@ -274,7 +274,7 @@ class TestAllTypes(Message): default_double: Optional[float] = ..., default_bool: Optional[bool] = ..., default_string: Optional[Text] = ..., - default_bytes: Optional[str] = ..., + default_bytes: Optional[bytes] = ..., default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., default_foreign_enum: Optional[ForeignEnum] = ..., default_import_enum: Optional[ImportEnum] = ..., @@ -283,12 +283,12 @@ class TestAllTypes(Message): oneof_uint32: Optional[int] = ..., oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes: ... + def FromString(cls, s: bytes) -> TestAllTypes: ... class ForeignMessage(Message): @@ -299,7 +299,7 @@ class ForeignMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ForeignMessage: ... + def FromString(cls, s: bytes) -> ForeignMessage: ... class TestNoArenaMessage(Message): @@ -312,4 +312,4 @@ class TestNoArenaMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNoArenaMessage: ... + def FromString(cls, s: bytes) -> TestNoArenaMessage: ... diff --git a/third_party/2/google/protobuf/unittest_no_generic_services_pb2.pyi b/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi similarity index 65% rename from third_party/2/google/protobuf/unittest_no_generic_services_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi index 0e4fe03c2..02ac3be06 100644 --- a/third_party/2/google/protobuf/unittest_no_generic_services_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi @@ -11,19 +11,19 @@ from typing import ( class TestEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestEnum: ... + def Value(cls, name: bytes) -> TestEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestEnum]]: ... FOO: TestEnum @@ -37,4 +37,4 @@ class TestMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessage: ... + def FromString(cls, s: bytes) -> TestMessage: ... diff --git a/third_party/2/google/protobuf/unittest_pb2.pyi b/third_party/2and3/google/protobuf/unittest_pb2.pyi similarity index 85% rename from third_party/2/google/protobuf/unittest_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_pb2.pyi index 1fbd014fe..73792b46d 100644 --- a/third_party/2/google/protobuf/unittest_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_pb2.pyi @@ -26,19 +26,19 @@ from typing import ( class ForeignEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ForeignEnum: ... + def Value(cls, name: bytes) -> ForeignEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ForeignEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, ForeignEnum]]: ... + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... FOREIGN_FOO: ForeignEnum @@ -48,19 +48,19 @@ FOREIGN_BAZ: ForeignEnum class TestEnumWithDupValue(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestEnumWithDupValue: ... + def Value(cls, name: bytes) -> TestEnumWithDupValue: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestEnumWithDupValue]: ... @classmethod - def items(cls) -> List[Tuple[str, TestEnumWithDupValue]]: ... + def items(cls) -> List[Tuple[bytes, TestEnumWithDupValue]]: ... FOO1: TestEnumWithDupValue @@ -72,19 +72,19 @@ BAR2: TestEnumWithDupValue class TestSparseEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestSparseEnum: ... + def Value(cls, name: bytes) -> TestSparseEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestSparseEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestSparseEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestSparseEnum]]: ... SPARSE_A: TestSparseEnum @@ -99,19 +99,19 @@ SPARSE_G: TestSparseEnum class TestAllTypes(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestAllTypes.NestedEnum: ... + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestAllTypes.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestAllTypes.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... FOO: NestedEnum BAR: NestedEnum BAZ: NestedEnum @@ -125,7 +125,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.NestedMessage: ... + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... class OptionalGroup(Message): a = ... # type: int @@ -135,7 +135,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.OptionalGroup: ... + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... class RepeatedGroup(Message): a = ... # type: int @@ -145,7 +145,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.RepeatedGroup: ... + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... optional_int32 = ... # type: int optional_int64 = ... # type: int optional_uint32 = ... # type: int @@ -160,7 +160,7 @@ class TestAllTypes(Message): optional_double = ... # type: float optional_bool = ... # type: bool optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes optional_nested_enum = ... # type: TestAllTypes.NestedEnum optional_foreign_enum = ... # type: ForeignEnum optional_import_enum = ... # type: ImportEnum @@ -180,7 +180,7 @@ class TestAllTypes(Message): repeated_double = ... # type: RepeatedScalarFieldContainer[float] repeated_bool = ... # type: RepeatedScalarFieldContainer[bool] repeated_string = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes = ... # type: RepeatedScalarFieldContainer[bytes] repeated_nested_enum = ... # type: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] repeated_foreign_enum = ... # type: RepeatedScalarFieldContainer[ForeignEnum] repeated_import_enum = ... # type: RepeatedScalarFieldContainer[ImportEnum] @@ -200,7 +200,7 @@ class TestAllTypes(Message): default_double = ... # type: float default_bool = ... # type: bool default_string = ... # type: Text - default_bytes = ... # type: str + default_bytes = ... # type: bytes default_nested_enum = ... # type: TestAllTypes.NestedEnum default_foreign_enum = ... # type: ForeignEnum default_import_enum = ... # type: ImportEnum @@ -208,7 +208,7 @@ class TestAllTypes(Message): default_cord = ... # type: Text oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes @property def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... @@ -266,7 +266,7 @@ class TestAllTypes(Message): optional_double: Optional[float] = ..., optional_bool: Optional[bool] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., optional_foreign_message: Optional[ForeignMessage] = ..., @@ -292,7 +292,7 @@ class TestAllTypes(Message): repeated_double: Optional[Iterable[float]] = ..., repeated_bool: Optional[Iterable[bool]] = ..., repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[str]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., @@ -317,7 +317,7 @@ class TestAllTypes(Message): default_double: Optional[float] = ..., default_bool: Optional[bool] = ..., default_string: Optional[Text] = ..., - default_bytes: Optional[str] = ..., + default_bytes: Optional[bytes] = ..., default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., default_foreign_enum: Optional[ForeignEnum] = ..., default_import_enum: Optional[ImportEnum] = ..., @@ -326,11 +326,11 @@ class TestAllTypes(Message): oneof_uint32: Optional[int] = ..., oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes: ... + def FromString(cls, s: bytes) -> TestAllTypes: ... class NestedTestAllTypes(Message): @@ -352,7 +352,7 @@ class NestedTestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> NestedTestAllTypes: ... + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... class TestDeprecatedFields(Message): @@ -365,7 +365,7 @@ class TestDeprecatedFields(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDeprecatedFields: ... + def FromString(cls, s: bytes) -> TestDeprecatedFields: ... class TestDeprecatedMessage(Message): @@ -374,7 +374,7 @@ class TestDeprecatedMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDeprecatedMessage: ... + def FromString(cls, s: bytes) -> TestDeprecatedMessage: ... class ForeignMessage(Message): @@ -387,7 +387,7 @@ class ForeignMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ForeignMessage: ... + def FromString(cls, s: bytes) -> ForeignMessage: ... class TestReservedFields(Message): @@ -396,7 +396,7 @@ class TestReservedFields(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestReservedFields: ... + def FromString(cls, s: bytes) -> TestReservedFields: ... class TestAllExtensions(Message): @@ -405,7 +405,7 @@ class TestAllExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllExtensions: ... + def FromString(cls, s: bytes) -> TestAllExtensions: ... class OptionalGroup_extension(Message): @@ -416,7 +416,7 @@ class OptionalGroup_extension(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> OptionalGroup_extension: ... + def FromString(cls, s: bytes) -> OptionalGroup_extension: ... class RepeatedGroup_extension(Message): @@ -427,7 +427,7 @@ class RepeatedGroup_extension(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> RepeatedGroup_extension: ... + def FromString(cls, s: bytes) -> RepeatedGroup_extension: ... class TestGroup(Message): @@ -439,7 +439,7 @@ class TestGroup(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestGroup.OptionalGroup: ... + def FromString(cls, s: bytes) -> TestGroup.OptionalGroup: ... optional_foreign_enum = ... # type: ForeignEnum @property @@ -451,7 +451,7 @@ class TestGroup(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestGroup: ... + def FromString(cls, s: bytes) -> TestGroup: ... class TestGroupExtension(Message): @@ -460,7 +460,7 @@ class TestGroupExtension(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestGroupExtension: ... + def FromString(cls, s: bytes) -> TestGroupExtension: ... class TestNestedExtension(Message): @@ -473,13 +473,13 @@ class TestNestedExtension(Message): @classmethod def FromString( - cls, s: str) -> TestNestedExtension.OptionalGroup_extension: ... + cls, s: bytes) -> TestNestedExtension.OptionalGroup_extension: ... def __init__(self, ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedExtension: ... + def FromString(cls, s: bytes) -> TestNestedExtension: ... class TestRequired(Message): @@ -554,7 +554,7 @@ class TestRequired(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequired: ... + def FromString(cls, s: bytes) -> TestRequired: ... class TestRequiredForeign(Message): @@ -574,7 +574,7 @@ class TestRequiredForeign(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequiredForeign: ... + def FromString(cls, s: bytes) -> TestRequiredForeign: ... class TestRequiredMessage(Message): @@ -596,7 +596,7 @@ class TestRequiredMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequiredMessage: ... + def FromString(cls, s: bytes) -> TestRequiredMessage: ... class TestForeignNested(Message): @@ -609,7 +609,7 @@ class TestForeignNested(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestForeignNested: ... + def FromString(cls, s: bytes) -> TestForeignNested: ... class TestEmptyMessage(Message): @@ -618,7 +618,7 @@ class TestEmptyMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEmptyMessage: ... + def FromString(cls, s: bytes) -> TestEmptyMessage: ... class TestEmptyMessageWithExtensions(Message): @@ -627,7 +627,7 @@ class TestEmptyMessageWithExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEmptyMessageWithExtensions: ... + def FromString(cls, s: bytes) -> TestEmptyMessageWithExtensions: ... class TestMultipleExtensionRanges(Message): @@ -636,7 +636,7 @@ class TestMultipleExtensionRanges(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMultipleExtensionRanges: ... + def FromString(cls, s: bytes) -> TestMultipleExtensionRanges: ... class TestReallyLargeTagNumber(Message): @@ -649,7 +649,7 @@ class TestReallyLargeTagNumber(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestReallyLargeTagNumber: ... + def FromString(cls, s: bytes) -> TestReallyLargeTagNumber: ... class TestRecursiveMessage(Message): @@ -664,7 +664,7 @@ class TestRecursiveMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRecursiveMessage: ... + def FromString(cls, s: bytes) -> TestRecursiveMessage: ... class TestMutualRecursionA(Message): @@ -678,7 +678,7 @@ class TestMutualRecursionA(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMutualRecursionA.SubMessage: ... + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubMessage: ... class SubGroup(Message): @@ -694,7 +694,7 @@ class TestMutualRecursionA(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMutualRecursionA.SubGroup: ... + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubGroup: ... @property def bb(self) -> TestMutualRecursionB: ... @@ -708,7 +708,7 @@ class TestMutualRecursionA(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMutualRecursionA: ... + def FromString(cls, s: bytes) -> TestMutualRecursionA: ... class TestMutualRecursionB(Message): @@ -723,7 +723,7 @@ class TestMutualRecursionB(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMutualRecursionB: ... + def FromString(cls, s: bytes) -> TestMutualRecursionB: ... class TestIsInitialized(Message): @@ -737,7 +737,7 @@ class TestIsInitialized(Message): @classmethod def FromString( - cls, s: str) -> TestIsInitialized.SubMessage.SubGroup: ... + cls, s: bytes) -> TestIsInitialized.SubMessage.SubGroup: ... @property def subgroup(self) -> TestIsInitialized.SubMessage.SubGroup: ... @@ -747,7 +747,7 @@ class TestIsInitialized(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestIsInitialized.SubMessage: ... + def FromString(cls, s: bytes) -> TestIsInitialized.SubMessage: ... @property def sub_message(self) -> TestIsInitialized.SubMessage: ... @@ -757,7 +757,7 @@ class TestIsInitialized(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestIsInitialized: ... + def FromString(cls, s: bytes) -> TestIsInitialized: ... class TestDupFieldNumber(Message): @@ -769,7 +769,7 @@ class TestDupFieldNumber(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDupFieldNumber.Foo: ... + def FromString(cls, s: bytes) -> TestDupFieldNumber.Foo: ... class Bar(Message): a = ... # type: int @@ -779,7 +779,7 @@ class TestDupFieldNumber(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDupFieldNumber.Bar: ... + def FromString(cls, s: bytes) -> TestDupFieldNumber.Bar: ... a = ... # type: int @property @@ -795,7 +795,7 @@ class TestDupFieldNumber(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDupFieldNumber: ... + def FromString(cls, s: bytes) -> TestDupFieldNumber: ... class TestEagerMessage(Message): @@ -808,7 +808,7 @@ class TestEagerMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEagerMessage: ... + def FromString(cls, s: bytes) -> TestEagerMessage: ... class TestLazyMessage(Message): @@ -821,7 +821,7 @@ class TestLazyMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestLazyMessage: ... + def FromString(cls, s: bytes) -> TestLazyMessage: ... class TestNestedMessageHasBits(Message): @@ -839,7 +839,7 @@ class TestNestedMessageHasBits(Message): @classmethod def FromString( - cls, s: str) -> TestNestedMessageHasBits.NestedMessage: ... + cls, s: bytes) -> TestNestedMessageHasBits.NestedMessage: ... @property def optional_nested_message( @@ -850,7 +850,7 @@ class TestNestedMessageHasBits(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMessageHasBits: ... + def FromString(cls, s: bytes) -> TestNestedMessageHasBits: ... class TestCamelCaseFieldNames(Message): @@ -888,7 +888,7 @@ class TestCamelCaseFieldNames(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestCamelCaseFieldNames: ... + def FromString(cls, s: bytes) -> TestCamelCaseFieldNames: ... class TestFieldOrderings(Message): @@ -902,7 +902,7 @@ class TestFieldOrderings(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestFieldOrderings.NestedMessage: ... + def FromString(cls, s: bytes) -> TestFieldOrderings.NestedMessage: ... my_string = ... # type: Text my_int = ... # type: int my_float = ... # type: float @@ -918,7 +918,7 @@ class TestFieldOrderings(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestFieldOrderings: ... + def FromString(cls, s: bytes) -> TestFieldOrderings: ... class TestExtensionOrderings1(Message): @@ -929,7 +929,7 @@ class TestExtensionOrderings1(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestExtensionOrderings1: ... + def FromString(cls, s: bytes) -> TestExtensionOrderings1: ... class TestExtensionOrderings2(Message): @@ -942,7 +942,7 @@ class TestExtensionOrderings2(Message): @classmethod def FromString( - cls, s: str) -> TestExtensionOrderings2.TestExtensionOrderings3: ... + cls, s: bytes) -> TestExtensionOrderings2.TestExtensionOrderings3: ... my_string = ... # type: Text def __init__(self, @@ -950,11 +950,11 @@ class TestExtensionOrderings2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestExtensionOrderings2: ... + def FromString(cls, s: bytes) -> TestExtensionOrderings2: ... class TestExtremeDefaultValues(Message): - escaped_bytes = ... # type: str + escaped_bytes = ... # type: bytes large_uint32 = ... # type: int large_uint64 = ... # type: int small_int32 = ... # type: int @@ -977,13 +977,13 @@ class TestExtremeDefaultValues(Message): nan_float = ... # type: float cpp_trigraph = ... # type: Text string_with_zero = ... # type: Text - bytes_with_zero = ... # type: str + bytes_with_zero = ... # type: bytes string_piece_with_zero = ... # type: Text cord_with_zero = ... # type: Text replacement_string = ... # type: Text def __init__(self, - escaped_bytes: Optional[str] = ..., + escaped_bytes: Optional[bytes] = ..., large_uint32: Optional[int] = ..., large_uint64: Optional[int] = ..., small_int32: Optional[int] = ..., @@ -1006,14 +1006,14 @@ class TestExtremeDefaultValues(Message): nan_float: Optional[float] = ..., cpp_trigraph: Optional[Text] = ..., string_with_zero: Optional[Text] = ..., - bytes_with_zero: Optional[str] = ..., + bytes_with_zero: Optional[bytes] = ..., string_piece_with_zero: Optional[Text] = ..., cord_with_zero: Optional[Text] = ..., replacement_string: Optional[Text] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestExtremeDefaultValues: ... + def FromString(cls, s: bytes) -> TestExtremeDefaultValues: ... class SparseEnumMessage(Message): @@ -1024,7 +1024,7 @@ class SparseEnumMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> SparseEnumMessage: ... + def FromString(cls, s: bytes) -> SparseEnumMessage: ... class OneString(Message): @@ -1035,7 +1035,7 @@ class OneString(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> OneString: ... + def FromString(cls, s: bytes) -> OneString: ... class MoreString(Message): @@ -1046,29 +1046,29 @@ class MoreString(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MoreString: ... + def FromString(cls, s: bytes) -> MoreString: ... class OneBytes(Message): - data = ... # type: str + data = ... # type: bytes def __init__(self, - data: Optional[str] = ..., + data: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> OneBytes: ... + def FromString(cls, s: bytes) -> OneBytes: ... class MoreBytes(Message): - data = ... # type: RepeatedScalarFieldContainer[str] + data = ... # type: RepeatedScalarFieldContainer[bytes] def __init__(self, - data: Optional[Iterable[str]] = ..., + data: Optional[Iterable[bytes]] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> MoreBytes: ... + def FromString(cls, s: bytes) -> MoreBytes: ... class Int32Message(Message): @@ -1079,7 +1079,7 @@ class Int32Message(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Int32Message: ... + def FromString(cls, s: bytes) -> Int32Message: ... class Uint32Message(Message): @@ -1090,7 +1090,7 @@ class Uint32Message(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Uint32Message: ... + def FromString(cls, s: bytes) -> Uint32Message: ... class Int64Message(Message): @@ -1101,7 +1101,7 @@ class Int64Message(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Int64Message: ... + def FromString(cls, s: bytes) -> Int64Message: ... class Uint64Message(Message): @@ -1112,7 +1112,7 @@ class Uint64Message(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Uint64Message: ... + def FromString(cls, s: bytes) -> Uint64Message: ... class BoolMessage(Message): @@ -1123,7 +1123,7 @@ class BoolMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> BoolMessage: ... + def FromString(cls, s: bytes) -> BoolMessage: ... class TestOneof(Message): @@ -1137,7 +1137,7 @@ class TestOneof(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof.FooGroup: ... + def FromString(cls, s: bytes) -> TestOneof.FooGroup: ... foo_int = ... # type: int foo_string = ... # type: Text @@ -1155,7 +1155,7 @@ class TestOneof(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof: ... + def FromString(cls, s: bytes) -> TestOneof: ... class TestOneofBackwardsCompatible(Message): @@ -1170,7 +1170,7 @@ class TestOneofBackwardsCompatible(Message): @classmethod def FromString( - cls, s: str) -> TestOneofBackwardsCompatible.FooGroup: ... + cls, s: bytes) -> TestOneofBackwardsCompatible.FooGroup: ... foo_int = ... # type: int foo_string = ... # type: Text @@ -1188,25 +1188,25 @@ class TestOneofBackwardsCompatible(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneofBackwardsCompatible: ... + def FromString(cls, s: bytes) -> TestOneofBackwardsCompatible: ... class TestOneof2(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestOneof2.NestedEnum: ... + def Value(cls, name: bytes) -> TestOneof2.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestOneof2.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestOneof2.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestOneof2.NestedEnum]]: ... FOO: NestedEnum BAR: NestedEnum BAZ: NestedEnum @@ -1221,7 +1221,7 @@ class TestOneof2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof2.FooGroup: ... + def FromString(cls, s: bytes) -> TestOneof2.FooGroup: ... class NestedMessage(Message): qux_int = ... # type: int @@ -1233,18 +1233,18 @@ class TestOneof2(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof2.NestedMessage: ... + def FromString(cls, s: bytes) -> TestOneof2.NestedMessage: ... foo_int = ... # type: int foo_string = ... # type: Text foo_cord = ... # type: Text foo_string_piece = ... # type: Text - foo_bytes = ... # type: str + foo_bytes = ... # type: bytes foo_enum = ... # type: TestOneof2.NestedEnum bar_int = ... # type: int bar_string = ... # type: Text bar_cord = ... # type: Text bar_string_piece = ... # type: Text - bar_bytes = ... # type: str + bar_bytes = ... # type: bytes bar_enum = ... # type: TestOneof2.NestedEnum baz_int = ... # type: int baz_string = ... # type: Text @@ -1263,7 +1263,7 @@ class TestOneof2(Message): foo_string: Optional[Text] = ..., foo_cord: Optional[Text] = ..., foo_string_piece: Optional[Text] = ..., - foo_bytes: Optional[str] = ..., + foo_bytes: Optional[bytes] = ..., foo_enum: Optional[TestOneof2.NestedEnum] = ..., foo_message: Optional[TestOneof2.NestedMessage] = ..., foogroup: Optional[TestOneof2.FooGroup] = ..., @@ -1272,14 +1272,14 @@ class TestOneof2(Message): bar_string: Optional[Text] = ..., bar_cord: Optional[Text] = ..., bar_string_piece: Optional[Text] = ..., - bar_bytes: Optional[str] = ..., + bar_bytes: Optional[bytes] = ..., bar_enum: Optional[TestOneof2.NestedEnum] = ..., baz_int: Optional[int] = ..., baz_string: Optional[Text] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof2: ... + def FromString(cls, s: bytes) -> TestOneof2: ... class TestRequiredOneof(Message): @@ -1291,7 +1291,7 @@ class TestRequiredOneof(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequiredOneof.NestedMessage: ... + def FromString(cls, s: bytes) -> TestRequiredOneof.NestedMessage: ... foo_int = ... # type: int foo_string = ... # type: Text @@ -1305,7 +1305,7 @@ class TestRequiredOneof(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRequiredOneof: ... + def FromString(cls, s: bytes) -> TestRequiredOneof: ... class TestPackedTypes(Message): @@ -1342,7 +1342,7 @@ class TestPackedTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestPackedTypes: ... + def FromString(cls, s: bytes) -> TestPackedTypes: ... class TestUnpackedTypes(Message): @@ -1379,7 +1379,7 @@ class TestUnpackedTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestUnpackedTypes: ... + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... class TestPackedExtensions(Message): @@ -1388,7 +1388,7 @@ class TestPackedExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestPackedExtensions: ... + def FromString(cls, s: bytes) -> TestPackedExtensions: ... class TestUnpackedExtensions(Message): @@ -1397,25 +1397,25 @@ class TestUnpackedExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestUnpackedExtensions: ... + def FromString(cls, s: bytes) -> TestUnpackedExtensions: ... class TestDynamicExtensions(Message): class DynamicEnumType(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestDynamicExtensions.DynamicEnumType: ... + def Value(cls, name: bytes) -> TestDynamicExtensions.DynamicEnumType: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestDynamicExtensions.DynamicEnumType]: ... @classmethod - def items(cls) -> List[Tuple[str, + def items(cls) -> List[Tuple[bytes, TestDynamicExtensions.DynamicEnumType]]: ... DYNAMIC_FOO: DynamicEnumType DYNAMIC_BAR: DynamicEnumType @@ -1430,7 +1430,7 @@ class TestDynamicExtensions(Message): @classmethod def FromString( - cls, s: str) -> TestDynamicExtensions.DynamicMessageType: ... + cls, s: bytes) -> TestDynamicExtensions.DynamicMessageType: ... scalar_extension = ... # type: int enum_extension = ... # type: ForeignEnum dynamic_enum_extension = ... # type: TestDynamicExtensions.DynamicEnumType @@ -1455,7 +1455,7 @@ class TestDynamicExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDynamicExtensions: ... + def FromString(cls, s: bytes) -> TestDynamicExtensions: ... class TestRepeatedScalarDifferentTagSizes(Message): @@ -1476,7 +1476,7 @@ class TestRepeatedScalarDifferentTagSizes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestRepeatedScalarDifferentTagSizes: ... + def FromString(cls, s: bytes) -> TestRepeatedScalarDifferentTagSizes: ... class TestParsingMerge(Message): @@ -1492,7 +1492,7 @@ class TestParsingMerge(Message): @classmethod def FromString( - cls, s: str) -> TestParsingMerge.RepeatedFieldsGenerator.Group1: ... + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group1: ... class Group2(Message): @@ -1505,7 +1505,7 @@ class TestParsingMerge(Message): @classmethod def FromString( - cls, s: str) -> TestParsingMerge.RepeatedFieldsGenerator.Group2: ... + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group2: ... @property def field1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... @@ -1542,7 +1542,7 @@ class TestParsingMerge(Message): @classmethod def FromString( - cls, s: str) -> TestParsingMerge.RepeatedFieldsGenerator: ... + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator: ... class OptionalGroup(Message): @@ -1554,7 +1554,7 @@ class TestParsingMerge(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestParsingMerge.OptionalGroup: ... + def FromString(cls, s: bytes) -> TestParsingMerge.OptionalGroup: ... class RepeatedGroup(Message): @@ -1566,7 +1566,7 @@ class TestParsingMerge(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestParsingMerge.RepeatedGroup: ... + def FromString(cls, s: bytes) -> TestParsingMerge.RepeatedGroup: ... @property def required_all_types(self) -> TestAllTypes: ... @@ -1594,7 +1594,7 @@ class TestParsingMerge(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestParsingMerge: ... + def FromString(cls, s: bytes) -> TestParsingMerge: ... class TestCommentInjectionMessage(Message): @@ -1605,7 +1605,7 @@ class TestCommentInjectionMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestCommentInjectionMessage: ... + def FromString(cls, s: bytes) -> TestCommentInjectionMessage: ... class FooRequest(Message): @@ -1614,7 +1614,7 @@ class FooRequest(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FooRequest: ... + def FromString(cls, s: bytes) -> FooRequest: ... class FooResponse(Message): @@ -1623,7 +1623,7 @@ class FooResponse(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FooResponse: ... + def FromString(cls, s: bytes) -> FooResponse: ... class FooClientMessage(Message): @@ -1632,7 +1632,7 @@ class FooClientMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FooClientMessage: ... + def FromString(cls, s: bytes) -> FooClientMessage: ... class FooServerMessage(Message): @@ -1641,7 +1641,7 @@ class FooServerMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FooServerMessage: ... + def FromString(cls, s: bytes) -> FooServerMessage: ... class BarRequest(Message): @@ -1650,7 +1650,7 @@ class BarRequest(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> BarRequest: ... + def FromString(cls, s: bytes) -> BarRequest: ... class BarResponse(Message): @@ -1659,7 +1659,7 @@ class BarResponse(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> BarResponse: ... + def FromString(cls, s: bytes) -> BarResponse: ... class TestJsonName(Message): @@ -1680,7 +1680,7 @@ class TestJsonName(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestJsonName: ... + def FromString(cls, s: bytes) -> TestJsonName: ... class TestHugeFieldNumbers(Message): @@ -1692,7 +1692,7 @@ class TestHugeFieldNumbers(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestHugeFieldNumbers.OptionalGroup: ... + def FromString(cls, s: bytes) -> TestHugeFieldNumbers.OptionalGroup: ... class StringStringMapEntry(Message): key = ... # type: Text @@ -1705,17 +1705,17 @@ class TestHugeFieldNumbers(Message): @classmethod def FromString( - cls, s: str) -> TestHugeFieldNumbers.StringStringMapEntry: ... + cls, s: bytes) -> TestHugeFieldNumbers.StringStringMapEntry: ... optional_int32 = ... # type: int fixed_32 = ... # type: int repeated_int32 = ... # type: RepeatedScalarFieldContainer[int] packed_int32 = ... # type: RepeatedScalarFieldContainer[int] optional_enum = ... # type: ForeignEnum optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes @property def optional_message(self) -> ForeignMessage: ... @@ -1736,18 +1736,18 @@ class TestHugeFieldNumbers(Message): packed_int32: Optional[Iterable[int]] = ..., optional_enum: Optional[ForeignEnum] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optional_message: Optional[ForeignMessage] = ..., optionalgroup: Optional[TestHugeFieldNumbers.OptionalGroup] = ..., string_string_map: Optional[Mapping[Text, Text]] = ..., oneof_uint32: Optional[int] = ..., oneof_test_all_types: Optional[TestAllTypes] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestHugeFieldNumbers: ... + def FromString(cls, s: bytes) -> TestHugeFieldNumbers: ... class TestExtensionInsideTable(Message): @@ -1774,4 +1774,4 @@ class TestExtensionInsideTable(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestExtensionInsideTable: ... + def FromString(cls, s: bytes) -> TestExtensionInsideTable: ... diff --git a/third_party/2/google/protobuf/unittest_proto3_arena_pb2.pyi b/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi similarity index 91% rename from third_party/2/google/protobuf/unittest_proto3_arena_pb2.pyi rename to third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi index 6b9eac934..de9c41270 100644 --- a/third_party/2/google/protobuf/unittest_proto3_arena_pb2.pyi +++ b/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi @@ -24,19 +24,19 @@ from typing import ( class ForeignEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> ForeignEnum: ... + def Value(cls, name: bytes) -> ForeignEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[ForeignEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, ForeignEnum]]: ... + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... FOREIGN_ZERO: ForeignEnum @@ -50,19 +50,19 @@ class TestAllTypes(Message): class NestedEnum(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> TestAllTypes.NestedEnum: ... + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[TestAllTypes.NestedEnum]: ... @classmethod - def items(cls) -> List[Tuple[str, TestAllTypes.NestedEnum]]: ... + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... ZERO: NestedEnum FOO: NestedEnum BAR: NestedEnum @@ -77,7 +77,7 @@ class TestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes.NestedMessage: ... + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... optional_int32 = ... # type: int optional_int64 = ... # type: int optional_uint32 = ... # type: int @@ -92,7 +92,7 @@ class TestAllTypes(Message): optional_double = ... # type: float optional_bool = ... # type: bool optional_string = ... # type: Text - optional_bytes = ... # type: str + optional_bytes = ... # type: bytes optional_nested_enum = ... # type: TestAllTypes.NestedEnum optional_foreign_enum = ... # type: ForeignEnum optional_string_piece = ... # type: Text @@ -111,14 +111,14 @@ class TestAllTypes(Message): repeated_double = ... # type: RepeatedScalarFieldContainer[float] repeated_bool = ... # type: RepeatedScalarFieldContainer[bool] repeated_string = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes = ... # type: RepeatedScalarFieldContainer[bytes] repeated_nested_enum = ... # type: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] repeated_foreign_enum = ... # type: RepeatedScalarFieldContainer[ForeignEnum] repeated_string_piece = ... # type: RepeatedScalarFieldContainer[Text] repeated_cord = ... # type: RepeatedScalarFieldContainer[Text] oneof_uint32 = ... # type: int oneof_string = ... # type: Text - oneof_bytes = ... # type: str + oneof_bytes = ... # type: bytes @property def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... @@ -172,7 +172,7 @@ class TestAllTypes(Message): optional_double: Optional[float] = ..., optional_bool: Optional[bool] = ..., optional_string: Optional[Text] = ..., - optional_bytes: Optional[str] = ..., + optional_bytes: Optional[bytes] = ..., optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., optional_foreign_message: Optional[ForeignMessage] = ..., optional_import_message: Optional[ImportMessage] = ..., @@ -197,7 +197,7 @@ class TestAllTypes(Message): repeated_double: Optional[Iterable[float]] = ..., repeated_bool: Optional[Iterable[bool]] = ..., repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[str]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., repeated_import_message: Optional[Iterable[ImportMessage]] = ..., @@ -209,11 +209,11 @@ class TestAllTypes(Message): oneof_uint32: Optional[int] = ..., oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[str] = ..., + oneof_bytes: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAllTypes: ... + def FromString(cls, s: bytes) -> TestAllTypes: ... class TestPackedTypes(Message): @@ -250,7 +250,7 @@ class TestPackedTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestPackedTypes: ... + def FromString(cls, s: bytes) -> TestPackedTypes: ... class TestUnpackedTypes(Message): @@ -287,7 +287,7 @@ class TestUnpackedTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestUnpackedTypes: ... + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... class NestedTestAllTypes(Message): @@ -309,7 +309,7 @@ class NestedTestAllTypes(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> NestedTestAllTypes: ... + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... class ForeignMessage(Message): @@ -320,7 +320,7 @@ class ForeignMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> ForeignMessage: ... + def FromString(cls, s: bytes) -> ForeignMessage: ... class TestEmptyMessage(Message): @@ -329,4 +329,4 @@ class TestEmptyMessage(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEmptyMessage: ... + def FromString(cls, s: bytes) -> TestEmptyMessage: ... diff --git a/third_party/2/google/protobuf/util/__init__.pyi b/third_party/2and3/google/protobuf/util/__init__.pyi similarity index 100% rename from third_party/2/google/protobuf/util/__init__.pyi rename to third_party/2and3/google/protobuf/util/__init__.pyi diff --git a/third_party/2/google/protobuf/util/json_format_proto3_pb2.pyi b/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi similarity index 87% rename from third_party/2/google/protobuf/util/json_format_proto3_pb2.pyi rename to third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi index 22fb0aa34..0921ce84c 100644 --- a/third_party/2/google/protobuf/util/json_format_proto3_pb2.pyi +++ b/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi @@ -51,19 +51,19 @@ from typing import ( class EnumType(int): @classmethod - def Name(cls, number: int) -> str: ... + def Name(cls, number: int) -> bytes: ... @classmethod - def Value(cls, name: str) -> EnumType: ... + def Value(cls, name: bytes) -> EnumType: ... @classmethod - def keys(cls) -> List[str]: ... + def keys(cls) -> List[bytes]: ... @classmethod def values(cls) -> List[EnumType]: ... @classmethod - def items(cls) -> List[Tuple[str, EnumType]]: ... + def items(cls) -> List[Tuple[bytes, EnumType]]: ... FOO: EnumType @@ -78,7 +78,7 @@ class MessageType(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> MessageType: ... + def FromString(cls, s: bytes) -> MessageType: ... class TestMessage(Message): @@ -90,7 +90,7 @@ class TestMessage(Message): float_value = ... # type: float double_value = ... # type: float string_value = ... # type: Text - bytes_value = ... # type: str + bytes_value = ... # type: bytes enum_value = ... # type: EnumType repeated_bool_value = ... # type: RepeatedScalarFieldContainer[bool] repeated_int32_value = ... # type: RepeatedScalarFieldContainer[int] @@ -100,7 +100,7 @@ class TestMessage(Message): repeated_float_value = ... # type: RepeatedScalarFieldContainer[float] repeated_double_value = ... # type: RepeatedScalarFieldContainer[float] repeated_string_value = ... # type: RepeatedScalarFieldContainer[Text] - repeated_bytes_value = ... # type: RepeatedScalarFieldContainer[str] + repeated_bytes_value = ... # type: RepeatedScalarFieldContainer[bytes] repeated_enum_value = ... # type: RepeatedScalarFieldContainer[EnumType] @property @@ -119,7 +119,7 @@ class TestMessage(Message): float_value: Optional[float] = ..., double_value: Optional[float] = ..., string_value: Optional[Text] = ..., - bytes_value: Optional[str] = ..., + bytes_value: Optional[bytes] = ..., enum_value: Optional[EnumType] = ..., message_value: Optional[MessageType] = ..., repeated_bool_value: Optional[Iterable[bool]] = ..., @@ -130,19 +130,19 @@ class TestMessage(Message): repeated_float_value: Optional[Iterable[float]] = ..., repeated_double_value: Optional[Iterable[float]] = ..., repeated_string_value: Optional[Iterable[Text]] = ..., - repeated_bytes_value: Optional[Iterable[str]] = ..., + repeated_bytes_value: Optional[Iterable[bytes]] = ..., repeated_enum_value: Optional[Iterable[EnumType]] = ..., repeated_message_value: Optional[Iterable[MessageType]] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMessage: ... + def FromString(cls, s: bytes) -> TestMessage: ... class TestOneof(Message): oneof_int32_value = ... # type: int oneof_string_value = ... # type: Text - oneof_bytes_value = ... # type: str + oneof_bytes_value = ... # type: bytes oneof_enum_value = ... # type: EnumType @property @@ -151,13 +151,13 @@ class TestOneof(Message): def __init__(self, oneof_int32_value: Optional[int] = ..., oneof_string_value: Optional[Text] = ..., - oneof_bytes_value: Optional[str] = ..., + oneof_bytes_value: Optional[bytes] = ..., oneof_enum_value: Optional[EnumType] = ..., oneof_message_value: Optional[MessageType] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestOneof: ... + def FromString(cls, s: bytes) -> TestOneof: ... class TestMap(Message): @@ -172,7 +172,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.BoolMapEntry: ... + def FromString(cls, s: bytes) -> TestMap.BoolMapEntry: ... class Int32MapEntry(Message): key = ... # type: int @@ -184,7 +184,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.Int32MapEntry: ... + def FromString(cls, s: bytes) -> TestMap.Int32MapEntry: ... class Int64MapEntry(Message): key = ... # type: int @@ -196,7 +196,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.Int64MapEntry: ... + def FromString(cls, s: bytes) -> TestMap.Int64MapEntry: ... class Uint32MapEntry(Message): key = ... # type: int @@ -208,7 +208,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.Uint32MapEntry: ... + def FromString(cls, s: bytes) -> TestMap.Uint32MapEntry: ... class Uint64MapEntry(Message): key = ... # type: int @@ -220,7 +220,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.Uint64MapEntry: ... + def FromString(cls, s: bytes) -> TestMap.Uint64MapEntry: ... class StringMapEntry(Message): key = ... # type: Text @@ -232,7 +232,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap.StringMapEntry: ... + def FromString(cls, s: bytes) -> TestMap.StringMapEntry: ... @property def bool_map(self) -> MutableMapping[bool, int]: ... @@ -262,7 +262,7 @@ class TestMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestMap: ... + def FromString(cls, s: bytes) -> TestMap: ... class TestNestedMap(Message): @@ -277,7 +277,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.BoolMapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.BoolMapEntry: ... class Int32MapEntry(Message): key = ... # type: int @@ -289,7 +289,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.Int32MapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.Int32MapEntry: ... class Int64MapEntry(Message): key = ... # type: int @@ -301,7 +301,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.Int64MapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.Int64MapEntry: ... class Uint32MapEntry(Message): key = ... # type: int @@ -313,7 +313,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.Uint32MapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.Uint32MapEntry: ... class Uint64MapEntry(Message): key = ... # type: int @@ -325,7 +325,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.Uint64MapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.Uint64MapEntry: ... class StringMapEntry(Message): key = ... # type: Text @@ -337,7 +337,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.StringMapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.StringMapEntry: ... class MapMapEntry(Message): key = ... # type: Text @@ -351,7 +351,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap.MapMapEntry: ... + def FromString(cls, s: bytes) -> TestNestedMap.MapMapEntry: ... @property def bool_map(self) -> MutableMapping[bool, int]: ... @@ -385,7 +385,7 @@ class TestNestedMap(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestNestedMap: ... + def FromString(cls, s: bytes) -> TestNestedMap: ... class TestWrapper(Message): @@ -475,7 +475,7 @@ class TestWrapper(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestWrapper: ... + def FromString(cls, s: bytes) -> TestWrapper: ... class TestTimestamp(Message): @@ -492,7 +492,7 @@ class TestTimestamp(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestTimestamp: ... + def FromString(cls, s: bytes) -> TestTimestamp: ... class TestDuration(Message): @@ -509,7 +509,7 @@ class TestDuration(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestDuration: ... + def FromString(cls, s: bytes) -> TestDuration: ... class TestFieldMask(Message): @@ -522,7 +522,7 @@ class TestFieldMask(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestFieldMask: ... + def FromString(cls, s: bytes) -> TestFieldMask: ... class TestStruct(Message): @@ -539,7 +539,7 @@ class TestStruct(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestStruct: ... + def FromString(cls, s: bytes) -> TestStruct: ... class TestAny(Message): @@ -556,7 +556,7 @@ class TestAny(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestAny: ... + def FromString(cls, s: bytes) -> TestAny: ... class TestValue(Message): @@ -573,7 +573,7 @@ class TestValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestValue: ... + def FromString(cls, s: bytes) -> TestValue: ... class TestListValue(Message): @@ -590,7 +590,7 @@ class TestListValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestListValue: ... + def FromString(cls, s: bytes) -> TestListValue: ... class TestBoolValue(Message): @@ -605,7 +605,7 @@ class TestBoolValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestBoolValue.BoolMapEntry: ... + def FromString(cls, s: bytes) -> TestBoolValue.BoolMapEntry: ... bool_value = ... # type: bool @property @@ -617,7 +617,7 @@ class TestBoolValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestBoolValue: ... + def FromString(cls, s: bytes) -> TestBoolValue: ... class TestCustomJsonName(Message): @@ -628,7 +628,7 @@ class TestCustomJsonName(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestCustomJsonName: ... + def FromString(cls, s: bytes) -> TestCustomJsonName: ... class TestExtensions(Message): @@ -641,7 +641,7 @@ class TestExtensions(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestExtensions: ... + def FromString(cls, s: bytes) -> TestExtensions: ... class TestEnumValue(Message): @@ -656,4 +656,4 @@ class TestEnumValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> TestEnumValue: ... + def FromString(cls, s: bytes) -> TestEnumValue: ... diff --git a/third_party/2/google/protobuf/wrappers_pb2.pyi b/third_party/2and3/google/protobuf/wrappers_pb2.pyi similarity index 74% rename from third_party/2/google/protobuf/wrappers_pb2.pyi rename to third_party/2and3/google/protobuf/wrappers_pb2.pyi index 1704e5423..ded665202 100644 --- a/third_party/2/google/protobuf/wrappers_pb2.pyi +++ b/third_party/2and3/google/protobuf/wrappers_pb2.pyi @@ -15,7 +15,7 @@ class DoubleValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> DoubleValue: ... + def FromString(cls, s: bytes) -> DoubleValue: ... class FloatValue(Message): @@ -26,7 +26,7 @@ class FloatValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> FloatValue: ... + def FromString(cls, s: bytes) -> FloatValue: ... class Int64Value(Message): @@ -37,7 +37,7 @@ class Int64Value(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Int64Value: ... + def FromString(cls, s: bytes) -> Int64Value: ... class UInt64Value(Message): @@ -48,7 +48,7 @@ class UInt64Value(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> UInt64Value: ... + def FromString(cls, s: bytes) -> UInt64Value: ... class Int32Value(Message): @@ -59,7 +59,7 @@ class Int32Value(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> Int32Value: ... + def FromString(cls, s: bytes) -> Int32Value: ... class UInt32Value(Message): @@ -70,7 +70,7 @@ class UInt32Value(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> UInt32Value: ... + def FromString(cls, s: bytes) -> UInt32Value: ... class BoolValue(Message): @@ -81,7 +81,7 @@ class BoolValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> BoolValue: ... + def FromString(cls, s: bytes) -> BoolValue: ... class StringValue(Message): @@ -92,15 +92,15 @@ class StringValue(Message): ) -> None: ... @classmethod - def FromString(cls, s: str) -> StringValue: ... + def FromString(cls, s: bytes) -> StringValue: ... class BytesValue(Message): - value = ... # type: str + value = ... # type: bytes def __init__(self, - value: Optional[str] = ..., + value: Optional[bytes] = ..., ) -> None: ... @classmethod - def FromString(cls, s: str) -> BytesValue: ... + def FromString(cls, s: bytes) -> BytesValue: ...