[Python] Number of arguments was 3 and is now 3 -- Strange Pylint(W0221:arguments-differ) on...

Discussão em 'Python' iniciado por Stack, Agosto 26, 2025.

  1. Stack

    Stack Membro Participativo

    When I try to override the logging behaviour in my BaseHTTPRequestHandler-subclass like this:

    from http.server import BaseHTTPRequestHandler

    class MyHandler(BaseHTTPRequestHandler):

    def log_message(self, fmt, *args):
    pass


    I get this warning


    "Number of parameters was 3 in 'BaseHTTPRequestHandler.log_message' and is now 3 in overriding 'MyHandler.log_message' method Pylint(W0221:arguments-differ)"
    ​

    This is strange because the number of arguments is obviously correct, as the message itself states. Is the varargs (*args) causing a problem with inheritance here?

    Continue reading...

Compartilhe esta Página