dry-python / dry-python/returns

Mypy complains when currying a class

オープン
#1,476 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
4.4k
フォーク
155
平均マージ
2時間 27分
マージ済み PR(30日)
22

説明

# Bug report

Hi, I'm trying to curry a class constructor, but mypy complains

## What's wrong

```py
# 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
```
## How is that should be

mypy should not report any error

## System information

- `python` version: 3.10.4
- `returns` version: 0.19.0
- `mypy` version: 0.971

- `hypothesis` version (if any): not installed
- `pytest` version (if any): not installed

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。