We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm trying to curry a class constructor, but mypy complains
# main.py from returns.curry import curry @curry class Person: def __init__(self, name: str, age: int): self.name = name self.age = age Person("bob")(33)
$ mypy main.py main.py:10: error: Missing positional argument "age" in call to "Person" main.py:10: error: "Person" not callable Found 2 errors in 1 file (checked 1 source file)
Here is my mypy.ini file:
[mypy] plugins = returns.contrib.mypy.returns_plugin
mypy should not report any error
python version: 3.10.4
python
returns version: 0.19.0
returns
mypy version: 0.971
mypy
hypothesis version (if any): not installed
hypothesis
pytest version (if any): not installed
pytest
The text was updated successfully, but these errors were encountered:
This is a known issue.
Sorry, something went wrong.
Thank you for this piece of information :)
Try this:
returns/typesafety/test_curry/test_curry/test_curry_arguments.yml
Line 75 in 964479d
mypy doesn't complain about that:
from returns.curry import curry class Test(object): @curry def __init__(self, arg: int, other: str) -> None: ... Test(1)
But does complain about that:
Test(1)("")
$ mypy main.py main.py:9: error: "Test" not callable Found 1 error in 1 file (checked 1 source file)
In both cases, python doesn't seem to like the curry on __init__:
__init__
$ python main.py Traceback (most recent call last): File "/Users/jul/dev/bug-curry/main.py", line 9, in <module> Test(1) TypeError: __init__() should return None, not 'function'
No branches or pull requests
Bug report
Hi, I'm trying to curry a class constructor, but mypy complains
What's wrong
Here is my mypy.ini file:
How is that should be
mypy should not report any error
System information
python
version: 3.10.4returns
version: 0.19.0mypy
version: 0.971hypothesis
version (if any): not installedpytest
version (if any): not installedThe text was updated successfully, but these errors were encountered: