no error when you don't call `super().__init__`
Open
Nobody has claimed this yet.
feature
topic-inheritance
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
class Foo:
def __init__(self, value:int) -> None:
self.value = value
class Bar(Foo):
def __init__(self) -> None:
pass
a = Bar().value # runtime error
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 Python reproducer and the linked mypy-play example, then trace how mypy analyzes the Foo and Bar constructors and the access to Bar().value. Determine the expected diagnostic for a subclass initializer that omits super().init; done means this case is consistently reported with suitable regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100