Refa: fake doc ID. (#10276)

### What problem does this PR solve?
#10273
### Type of change

- [x] Refactoring
This commit is contained in:
Kevin Hu
2025-09-25 13:52:50 +08:00
committed by GitHub
parent 1b19d302c5
commit d907e79893
6 changed files with 45 additions and 14 deletions

View File

@ -679,7 +679,9 @@ TimeoutException = Union[Type[BaseException], BaseException]
OnTimeoutCallback = Union[Callable[..., Any], Coroutine[Any, Any, Any]]
def timeout(seconds: float | int = None, attempts: int = 2, *, exception: Optional[TimeoutException] = None, on_timeout: Optional[OnTimeoutCallback] = None):
def timeout(seconds: float | int | str = None, attempts: int = 2, *, exception: Optional[TimeoutException] = None, on_timeout: Optional[OnTimeoutCallback] = None):
if isinstance(seconds, str):
seconds = float(seconds)
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):