[Python] type hinting signature of handler for signal.signal

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I can't get the type hinting for the handler of signal.signal(signum, handler) right, and I don't know what to import

    class someclass:
    def handler(self, signum, frame):
    pass

    def __init__() -> None:
    signal.signal(signal.SIGINT, self.handler):


    I'm somehow surprised that it seems that signum seems to be an int...

    Continue reading...

Compartilhe esta Página