We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c970b5 commit c55ee08Copy full SHA for c55ee08
python/google/protobuf/internal/enum_type_wrapper.py
@@ -45,6 +45,13 @@ class EnumTypeWrapper(object):
45
46
DESCRIPTOR = None
47
48
+ # This is a type alias, which mypy typing stubs can type as
49
+ # a genericized parameter constrained to an int, allowing subclasses
50
+ # to be typed with more constraint
51
+ # Eg.
52
+ # def Name(self, number: MyGeneratedEnum.V) -> str
53
+ V = int
54
+
55
def __init__(self, enum_type):
56
"""Inits EnumTypeWrapper with an EnumDescriptor."""
57
self._enum_type = enum_type
0 commit comments