[Python] Python type for dict-like object [duplicate]

Discussão em 'Python' iniciado por Stack, Dezembro 7, 2024.

  1. Stack

    Stack Membro Participativo

    I have some function that accepts a dict-like object.

    from typing import Dict

    def handle(x: Dict[str, str]):
    pass # Do some processing here...


    I still get a type warning if I try passing a Shelf to the function, even though the function supports it. How to I specify the type of a dict-like object?

    Continue reading...

Compartilhe esta Página