diff --git a/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi b/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi index 18da7c230..95b5b4bb2 100644 --- a/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi +++ b/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi @@ -6,7 +6,10 @@ _V = TypeVar("_V", bound=int) # Expose a generic version so that those using mypy-protobuf # can get autogenerated NewType wrapper around the int values -class _EnumTypeWrapper(Generic[_V]): +# NOTE: this doesn't actually inherit from type, +# but mypy doesn't support metaclasses that don't inherit from type, +# so we pretend it does in the stubs... +class _EnumTypeWrapper(type, Generic[_V]): DESCRIPTOR: EnumDescriptor def __init__(self, enum_type: EnumDescriptor) -> None: ... def Name(self, number: _V) -> str: ...