Skip to content

Commit bfbf173

Browse files
authored
fix: return "Self" from "BaseRetrying.copy" (#518)
1 parent 212c47c commit bfbf173

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tenacity/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
if t.TYPE_CHECKING:
8989
import types
9090

91+
from typing_extensions import Self
92+
9193
from . import asyncio as tasyncio
9294
from .retry import RetryBaseT
9395
from .stop import StopBaseT
@@ -255,7 +257,7 @@ def copy(
255257
retry_error_callback: t.Union[
256258
t.Optional[t.Callable[["RetryCallState"], t.Any]], object
257259
] = _unset,
258-
) -> "BaseRetrying":
260+
) -> "Self":
259261
"""Copy this object with some parameters changed if needed."""
260262
return self.__class__(
261263
sleep=_first_set(sleep, self.sleep),

0 commit comments

Comments
 (0)