Skip to content

logging module LogRecord __init__ mismatch #9913

Closed
@aminalaee

Description

@aminalaee

According to the Python docs for the LogRecord in logging module the msg 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:

But the msg input argument is set to object:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions