From 2fc6c41de5e7430b5bb0f0d46fbf4a1800819083 Mon Sep 17 00:00:00 2001 From: Nicholas Barker Date: Mon, 19 May 2025 23:14:12 -0400 Subject: [PATCH] Fix docstring default handling --- tooldantic/builder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tooldantic/builder.py b/tooldantic/builder.py index 7854818..7d077d6 100644 --- a/tooldantic/builder.py +++ b/tooldantic/builder.py @@ -100,10 +100,8 @@ def model_from_function( raise ToolError(message) if param.default is not _Empty: default = param.default - elif ( - docstring_default := docstring.get(name, {}).get("default") is not None - ): - default = docstring_default + elif docstring.get(name, {}).get("default") is not None: + default = docstring.get(name, {}).get("default") else: default = _Empty processed_field = self._process_field(