[Python] Using object type in function definitions as the top most unknown type

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

  1. Stack

    Stack Membro Participativo

    In TypeScript we have the “unknown” type that sits at the top of the type hierarchy and requires narrowing before doing anything with a variable.

    But in Python there's no such concept. It appears that the closest equivalent is "object", but it's not the same.

    Have you ever used “object” with type guards in Python like this?

    [​IMG]

    Continue reading...

Compartilhe esta Página