Skip to content

Callable[[], Any] vs Callable[[], object] #6117

Closed
@Akuli

Description

@Akuli

Often the return value of a callback function is ignored. In those cases, I have previously used Callable[[], None], but then @srittau told me to use Callable[[], Any], and I changed all stubs I had written to typeshed.

It seems like Callable[[], object] does the same thing as Callable[[], Any] though, and when used in a .py file, also prevents accidentally doing something with the return value. Would it be preferable in typeshed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: policyOrganization of the typeshed project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions