Allow unicode and bytes in EnumTypeWrapper.Value (#5743)

This commit is contained in:
Nipunn Koorapati
2021-07-09 02:22:38 -07:00
committed by GitHub
parent fdf073627c
commit c5dd23ac0d

View File

@@ -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]]: ...