From a451280b2c5a9ddfee650a8e51ed4b076f673b5a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 10 Apr 2026 20:40:21 +0100 Subject: [PATCH] Fix classes with metaclasses to not fail at runtime --- conformance/tests/dataclasses_transform_meta.py | 4 ++-- conformance/tests/protocols_class_objects.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conformance/tests/dataclasses_transform_meta.py b/conformance/tests/dataclasses_transform_meta.py index c38b077a6..cf33df87d 100644 --- a/conformance/tests/dataclasses_transform_meta.py +++ b/conformance/tests/dataclasses_transform_meta.py @@ -25,8 +25,8 @@ def model_field( class ModelMeta(type): not_a_field: str - def __init__(self, not_a_field: str) -> None: - self.not_a_field = not_a_field + def __init__(self, *args, **kwargs) -> None: + self.not_a_field: str = "not a field" class ModelBase(metaclass=ModelMeta): diff --git a/conformance/tests/protocols_class_objects.py b/conformance/tests/protocols_class_objects.py index 7ffc5e7cb..79de51204 100644 --- a/conformance/tests/protocols_class_objects.py +++ b/conformance/tests/protocols_class_objects.py @@ -93,8 +93,8 @@ class ConcreteC2: class CMeta(type): attr1: int - def __init__(self, attr1: int) -> None: - self.attr1 = attr1 + def __init__(self, *args, **kwargs) -> None: + self.attr1: int = 1 class ConcreteC3(metaclass=CMeta):