From bc5ddb56367f8410fd2ab78f3d5c20834b7beae9 Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Tue, 24 Mar 2026 11:52:48 +0000 Subject: [PATCH] from_field should return typing.Self not Field --- src/ducktools/classbuilder/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ducktools/classbuilder/__init__.pyi b/src/ducktools/classbuilder/__init__.pyi index 24bd33b..c5b9113 100644 --- a/src/ducktools/classbuilder/__init__.pyi +++ b/src/ducktools/classbuilder/__init__.pyi @@ -215,7 +215,7 @@ class Field(metaclass=SlotMakerMeta): def __eq__(self, other: Field | object) -> bool: ... def validate_field(self) -> None: ... @classmethod - def from_field(cls, fld: Field, /, **kwargs: typing.Any) -> Field: ... + def from_field(cls, fld: Field, /, **kwargs: typing.Any) -> typing.Self: ... # These types only exist because type[Field] doesn't seem to resolve correctly # Technically they're wrong as `isinstance` gets used