[Python] How to type hinte higher-order functions in python 3.6? [duplicate]

Discussão em 'Python' iniciado por Stack, Julho 10, 2025.

  1. Stack

    Stack Membro Participativo

    In the following code:

    def b(i: int) -> int:
    return i

    def a(i: int, b: ?) -> int:
    return i + b(i)

    print(a(1, b))


    How do we type hinting the function b: ? that is a parameter of a? Thank you.

    Continue reading...

Compartilhe esta Página