File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/toolbox-core/src/toolbox_core Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ def __init__(
56
56
self .__loop = loop
57
57
self .__thread = thread
58
58
59
+ # NOTE: We cannot define __qualname__ as a @property here.
60
+ # Properties are designed to compute values dynamically when accessed on an *instance* (using 'self').
61
+ # However, Python needs the class's __qualname__ attribute to be a plain string
62
+ # *before* any instances exist, specifically when the 'class ToolboxSyncTool:' statement
63
+ # itself is being processed during module import or class definition.
64
+ # Defining __qualname__ as a property leads to a TypeError because the class object needs
65
+ # a string value immediately, not a descriptor that evaluates later.
66
+ self .__qualname__ = f"{ self .__class__ .__qualname__ } .{ self .__name__ } "
67
+
59
68
@property
60
69
def __name__ (self ) -> str :
61
70
return self .__async_tool .__name__
@@ -78,10 +87,6 @@ def __annotations__(self) -> dict[str, Any]: # type: ignore[override]
78
87
# Mypy flags this issue in the type checks.
79
88
return self .__async_tool .__annotations__
80
89
81
- @property
82
- def __qualname__ (self ) -> str :
83
- return f"{ self .__class__ .__qualname__ } .{ self .__name__ } "
84
-
85
90
def __call__ (self , * args : Any , ** kwargs : Any ) -> str :
86
91
"""
87
92
Synchronously calls the remote tool with the provided arguments.
You can’t perform that action at this time.
0 commit comments