You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should just use str everywhere. If you are passing a non-string, and it isn't converted to a string anywhere in logging, it may fail when some completely unrelated code handles the log records elsewhere. IMO this is exactly what type checking is supposed to avoid.
According to the Python docs for the
LogRecord
inlogging
module themsg
argument and property is a string:https://docs.python.org/3/library/logging.html#logging.LogRecord
In the typeshed, the attribute is set to a
str
:typeshed/stdlib/logging/__init__.pyi
Line 392 in dd2818a
But the msg input argument is set to
object
:typeshed/stdlib/logging/__init__.pyi
Line 407 in dd2818a
And looking at the source the argument is not changed at all:
https://github.com/python/cpython/blob/7f760c2fca3dc5f46a518f5b7622783039bc8b7b/Lib/logging/__init__.py#L305
Unless this is for a backwards-compatible version, I guess this is a mismatch.
The text was updated successfully, but these errors were encountered: