From c5dd23ac0dc71cd535b4ac7273be0f3106025145 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Fri, 9 Jul 2021 02:22:38 -0700 Subject: [PATCH] Allow unicode and bytes in EnumTypeWrapper.Value (#5743) --- stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi b/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi index 079fca6a3..f85bb54bb 100644 --- a/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi +++ b/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi @@ -1,4 +1,4 @@ -from typing import Generic, List, Tuple, TypeVar, Union +from typing import Generic, List, Text, Tuple, TypeVar from google.protobuf.descriptor import EnumDescriptor @@ -10,7 +10,7 @@ class _EnumTypeWrapper(Generic[_V]): DESCRIPTOR: EnumDescriptor def __init__(self, enum_type: EnumDescriptor) -> None: ... def Name(self, number: _V) -> str: ... - def Value(self, name: Union[str, bytes]) -> _V: ... + def Value(self, name: Text | bytes) -> _V: ... def keys(self) -> List[str]: ... def values(self) -> List[_V]: ... def items(self) -> List[Tuple[str, _V]]: ...