Skip to content

reveal_type should indicate untyped defs with types #10509

@graingert

Description

@graingert

Feature

It's possible to make a def that's simultaneously typed and untyped eg: https://mypy-play.net/?mypy=latest&python=3.9&flags=disallow-untyped-calls&gist=7946ef5bbce794503defa44284147e56

Here Lock is "untyped" but appears to be a main.py:17: note: Revealed type is 'def () -> main.Lock'

Pitch
reveal_type should let me know that this object has an untyped constructor:

main.py:17: note: Revealed type is 'Untyped[def () -> main.Lock']

See also #5943 (comment)

this tripped up the anyio project in the definition of anyio.Lock agronholm/anyio#289

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions