Skip to content

Type inference should support Protocol-based Callables #677

@eb8680

Description

@eb8680

The expressiveness of the Callable type is somewhat limited. As recommended in the typing docs, in order to support richer and more precise generic function types, and applications like #526 that would consume them, we'd need to support callable Protocols in our type inference engine.

The PR #613 includes an encoding of inspect.Signatures as TypedDicts, so that TypedDict inference can be repurposed to support structural function type inference. Assuming that's correct, we could probably address this issue straightforwardly without the much bigger lift of supporting Protocols in general by building on top of that machinery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions