Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unicode and bytes in EnumTypeWrapper.Value #5743

Merged
merged 4 commits into from Jul 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions 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

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