Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us understand the issue:
- Are you reporting a bug, or opening a feature request?
Feature request
- Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
class Foo:
def __init__(self, bar: int):
pass
f = Foo()
- What is the actual behavior/output?
➜ python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
f = Foo()
TypeError: __init__() missing 1 required positional argument: 'bar'
~ via ⬢ 13.8.0 via 🐍 3.8.1
➜ mypy --pretty test.py
test.py:6: error: Too few arguments for "Foo"
f = Foo()
^
Found 1 error in 1 file (checked 1 source file)
- What is the behavior/output you expect?
mypy should say which arguments are missing, like Python does. This was fixed for functions in #505, but it doesn't seem to work for class init.
- What are the versions of mypy and Python you are using?
0.782, 3.8.1
- Do you see the same issue after installing mypy from Git master?
I have not tested this.
- What are the mypy flags you are using? (For example --strict-optional)
--pretty
- If mypy crashed with a traceback, please paste
the full traceback below.
(You can freely edit this text, please remove all the lines
you believe are unnecessary.)
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us understand the issue:
Feature request
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
mypy should say which arguments are missing, like Python does. This was fixed for functions in #505, but it doesn't seem to work for class init.
0.782, 3.8.1
I have not tested this.
--pretty
the full traceback below.
(You can freely edit this text, please remove all the lines
you believe are unnecessary.)