Skip to content

Commit dd4ebd9

Browse files
committed
fix mypy issue
1 parent d81a790 commit dd4ebd9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/toolbox-core/src/toolbox_core/sync_tool.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,22 @@ def __name__(self) -> str:
6262
return self.__async_tool.__name__
6363

6464
@property
65-
def __doc__(self) -> str | None: # Docstring can be None
66-
return self.__async_tool.__doc__
65+
def __doc__(self) -> Union[str, None]:
66+
# Standard Python object attributes like __doc__ are technically "writable".
67+
# But not defining a setter function makes this a read-only property.
68+
# Mypy flags this issue in the type checks.
69+
return self.__async_tool.__doc__ # type: ignore[override]
6770

6871
@property
6972
def __signature__(self) -> Signature:
7073
return self.__async_tool.__signature__
7174

7275
@property
7376
def __annotations__(self) -> dict[str, Any]:
74-
return self.__async_tool.__annotations__
77+
# Standard Python object attributes like __doc__ are technically "writable".
78+
# But not defining a setter function makes this a read-only property.
79+
# Mypy flags this issue in the type checks.
80+
return self.__async_tool.__annotations__ # type: ignore[override]
7581

7682
def __call__(self, *args: Any, **kwargs: Any) -> str:
7783
"""

0 commit comments

Comments
 (0)