Skip to content

Commit d81a53b

Browse files
committed
do not remove existing properties
1 parent 33dd451 commit d81a53b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import asyncio
1616
from asyncio import AbstractEventLoop
1717
from threading import Thread
18+
from inspect import Signature
1819
from typing import Any, Callable, Coroutine, Mapping, Sequence, TypeVar, Union
1920

2021
from .protocol import ParameterSchema
@@ -65,6 +66,28 @@ def __init__(
6566
# a string value immediately, not a descriptor that evaluates later.
6667
self.__qualname__ = f"{self.__class__.__qualname__}.{self.__async_tool._name}"
6768

69+
@property
70+
def __name__(self) -> str:
71+
return self.__async_tool.__name__
72+
73+
@property
74+
def __doc__(self) -> Union[str, None]: # type: ignore[override]
75+
# Standard Python object attributes like __doc__ are technically "writable".
76+
# But not defining a setter function makes this a read-only property.
77+
# Mypy flags this issue in the type checks.
78+
return self.__async_tool.__doc__
79+
80+
@property
81+
def __signature__(self) -> Signature:
82+
return self.__async_tool.__signature__
83+
84+
@property
85+
def __annotations__(self) -> dict[str, Any]: # type: ignore[override]
86+
# Standard Python object attributes like __doc__ are technically "writable".
87+
# But not defining a setter function makes this a read-only property.
88+
# Mypy flags this issue in the type checks.
89+
return self.__async_tool.__annotations__
90+
6891
@property
6992
def _name(self) -> str:
7093
return self.__async_tool._name

0 commit comments

Comments
 (0)