reveal_type should indicate untyped defs with types
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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 https://github.com/python/mypy/issues/5943#issuecomment-516075196
this tripped up the anyio project in the definition of anyio.Lock https://github.com/agronholm/anyio/pull/289
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked mypy-play example and the existing reveal_type behavior described in the issue. Determine how reveal_type should represent definitions that are both typed and untyped, then verify that the output distinguishes the untyped constructor while preserving the revealed function type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100