Skip to content

Commit 2d88150

Browse files
QEDadycopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 899563915
1 parent a298282 commit 2d88150

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

python/google/protobuf/internal/enum_type_wrapper.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,20 @@
1313
"""
1414

1515
import sys
16+
from typing import TYPE_CHECKING
1617

1718
__author__ = 'rabsatt@google.com (Kevin Rabsatt)'
1819

1920

20-
class EnumTypeWrapper(object):
21+
if TYPE_CHECKING:
22+
# EnumTypeWrapper is used as a metaclass during type checking, specifically
23+
# in the generated stub files.
24+
base = type
25+
else:
26+
base = object
27+
28+
29+
class EnumTypeWrapper(base):
2130
"""A utility for finding the names of enum values."""
2231

2332
DESCRIPTOR = None

0 commit comments

Comments
 (0)