From 799d39ff55888c42465a403a63221aaedf741d0e Mon Sep 17 00:00:00 2001 From: johnslavik Date: Thu, 8 Jan 2026 05:22:26 +0100 Subject: [PATCH 1/2] Correct the type of `Parameter.kind` attribute --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index 07c4e28f0d9952..0de9192e6124bc 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2683,7 +2683,7 @@ class Parameter: The annotation for the parameter if specified. If the parameter has no annotation, this attribute is set to `Parameter.empty`. - * kind : str + * kind : int Describes how argument values are bound to the parameter. Possible values: `Parameter.POSITIONAL_ONLY`, `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`, From b3c872d0ffb79076b20c46014e7910e3628a25c3 Mon Sep 17 00:00:00 2001 From: johnslavik Date: Thu, 8 Jan 2026 05:25:23 +0100 Subject: [PATCH 2/2] Elaborate on kinds --- Lib/inspect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index 0de9192e6124bc..0432ee115f3cd9 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2683,11 +2683,12 @@ class Parameter: The annotation for the parameter if specified. If the parameter has no annotation, this attribute is set to `Parameter.empty`. - * kind : int + * kind : int (enum) Describes how argument values are bound to the parameter. Possible values: `Parameter.POSITIONAL_ONLY`, `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`, `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`. + Every value has a `description` attribute describing meaning. """ __slots__ = ('_name', '_kind', '_default', '_annotation')