From bb33a082e99cb78df9d44dd0f75f0ce77b9ca99e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 19 Feb 2026 10:34:43 +0100 Subject: [PATCH] fix: make LoggerProtocol compatible with logging.Logger Remove the positional-only marker (/) from LoggerProtocol.log(). logging.Logger.log() defines msg as a regular parameter, so the positional-only constraint caused mypy to reject logging.Logger as incompatible with the protocol. Closes #554 Co-Authored-By: Claude Opus 4.6 Change-Id: Icc8ffaff0d828c5103c13e97dd2ca7701089713f --- tenacity/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tenacity/_utils.py b/tenacity/_utils.py index d8281738..6a12678b 100644 --- a/tenacity/_utils.py +++ b/tenacity/_utils.py @@ -33,7 +33,7 @@ class LoggerProtocol(typing.Protocol): """ def log( - self, level: int, msg: str, /, *args: typing.Any, **kwargs: typing.Any + self, level: int, msg: str, *args: typing.Any, **kwargs: typing.Any ) -> typing.Any: ...