From 9beaaf533740af678e7ff0ab06381e21296daaa8 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 19 Mar 2025 02:43:39 -0700 Subject: [PATCH 1/2] stubtest: understand override --- mypy/stubtest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index a0f886106715..8f78a6312017 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -1330,6 +1330,7 @@ def apply_decorator_to_funcitem( if ( decorator.fullname in ("builtins.staticmethod", "abc.abstractmethod") or decorator.fullname in mypy.types.OVERLOAD_NAMES + or decorator.fullname in mypy.types.OVERRIDE_DECORATOR_NAMES or decorator.fullname in mypy.types.FINAL_DECORATOR_NAMES ): return func From 73e19e32d426f15bb97c4877c8bcc73c96c549ab Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 19 Mar 2025 02:45:25 -0700 Subject: [PATCH 2/2] assert error --- mypy/stubtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index 8f78a6312017..ab29d9dca4b8 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -858,7 +858,7 @@ def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> Signature[nodes.Arg all_args: dict[str, list[tuple[nodes.Argument, int]]] = {} for func in map(_resolve_funcitem_from_decorator, stub.items): - assert func is not None + assert func is not None, "Failed to resolve decorated overload" args = maybe_strip_cls(stub.name, func.arguments) for index, arg in enumerate(args): # For positional-only args, we allow overloads to have different names for the same