New parser deviates from old parser in edge cases with function type comments
Open
Nobody has claimed this yet.
bug
topic-parser
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This is a follow-up for https://github.com/python/mypy/pull/21823. Most notably we get a false negative in situations like this:
class A:
def f(self):
# type: () -> None
def g(x):
# type: () -> None # Error not detected: signature has too few parameters
pass
cc @JukkaL
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 by reproducing the nested class and function example in the issue, then compare how the new and old parsers handle function type comments. The work is done when the new parser detects the inner function signature's missing parameter, matching the old parser's behavior in this edge case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100