-
-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Description
Is here a way to implement bind method in protocol without static analyzer complains?
class LoggerProtocol(Protocol):
def bind(self, **new_values: Any) -> Self: ...
def log(
self,
level: int,
event: str or None = None,
*args: Any,
**kwargs: Any
) -> None: ...
def info(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
def debug(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
def warning(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
def error(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
def exception(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
async def ainfo(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
async def adebug(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
async def awarning(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
async def aerror(self, event: str | None = None, *args: Any, **kw: Any) -> None: ...
async def aexception(self, event: str | None = None, *args: Any, **kw: Any) -> None: ... logger: BoundLogger = wrap_logger(None, processors=structlog_config.processors,
wrapper_class=structlog_config.wrapper_class,
cache_logger_on_first_use=structlog_config.cache_logger_on_first_use)
def test(logger: LoggerProtocol):
logger.info("test")runtime_checkable works fine, and is_instance method too, but IDE points at incorrect type
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels