dry-python / dry-python/returns

Mypy complains when currying a class

Abierto
#1,476 4 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
4.4k
Forks
155
Merge medio
2 h 27 min
PR fusionados (30 d)
22

Descripción

# 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.