Open swoutch opened 2 years ago
This is a known issue.
This is a known issue.
Thank you for this piece of information :)
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__
:
$ 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'
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 installed