From e01f730f7b296127a7c4c396a6e48827f1743510 Mon Sep 17 00:00:00 2001 From: bzoracler <50305397+bzoracler@users.noreply.github.com> Date: Tue, 13 May 2025 13:45:10 +1200 Subject: [PATCH 1/2] fix: User may not have provided return annotation --- autoapi/_objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoapi/_objects.py b/autoapi/_objects.py index 99e0b12e..324db121 100644 --- a/autoapi/_objects.py +++ b/autoapi/_objects.py @@ -280,7 +280,7 @@ def __init__(self, *args, **kwargs): Can be only be: async. """ - self.overloads: list[tuple[str, str]] = [ + self.overloads: list[tuple[str, str | None]] = [ (_format_args(args), return_annotation) for args, return_annotation in self.obj["overloads"] ] From 8c0e091d36668a20295f620cade4541859401cab Mon Sep 17 00:00:00 2001 From: bzoracler Date: Thu, 26 Jun 2025 16:51:48 +1200 Subject: [PATCH 2/2] fix: add missing release notes --- docs/changes/523.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/523.bugfix.rst diff --git a/docs/changes/523.bugfix.rst b/docs/changes/523.bugfix.rst new file mode 100644 index 00000000..6a0b232e --- /dev/null +++ b/docs/changes/523.bugfix.rst @@ -0,0 +1 @@ +Fix `PythonFunction.overloads` typing when source code overload(s) do not provide a return type