Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Mypy 1.6.1 fails with returns 0.21.0 on use of `curry.partial`

Abierto
#1,711 5 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
devtools

Línea de trabajo

Empieza por returns/contrib/mypy/_features/partial.py y returns/contrib/mypy/_typeops/inference.py, especialmente por las llamadas mostradas en el traceback. Reproduce el fallo con Python 3.11.4, returns 0.21.0 y mypy 1.6.1, y después inspecciona el cambio relevante en la mypy plugin API. La tarea está terminada cuando el ejemplo curry.partial se ejecuta sin el TypeError y muestra el tipo callable esperado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Bug report

I think mypy 1.6 has broken your plugin again. It seems like their API changes quite a lot. :(

What's wrong

my_partial = returns.curry.partial(foo, bar=baz(1))
reveal_type(my_partial)

Running mypy 1.6.1 against this, with the plugin installed and activated, results in:

https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.6.1
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5374, in accept
  File "mypy/nodes.py", line 1907, in accept
  File "mypy/checkexpr.py", line 452, in visit_call_expr
  File "mypy/checkexpr.py", line 581, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1420, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1514, in check_call
  File "mypy/checkexpr.py", line 1734, in check_callable_call
  File "mypy/checkexpr.py", line 1194, in apply_function_plugin
  File "*/.venv/lib/python3.11/site-packages/returns/contrib/mypy/_features/partial.py", line 67, in analyze
    ).new_partial()
      ^^^^^^^^^^^^^
  File "*/.venv/lib/python3.11/site-packages/returns/contrib/mypy/_features/partial.py", line 135, in new_partial
    partial = self._create_partial_case(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "*/.venv/lib/python3.11/site-packages/returns/contrib/mypy/_features/partial.py", line 167, in _create_partial_case
    ).from_usage(self._applied_args)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "*/.venv/lib/python3.11/site-packages/returns/contrib/mypy/_typeops/inference.py", line 61, in from_usage
    constraints = self._infer_constraints(applied_args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "*/.venv/lib/python3.11/site-packages/returns/contrib/mypy/_typeops/inference.py", line 83, in _infer_constraints
    constraints = infer_constraints_for_callable(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: infer_constraints_for_callable() missing required argument 'context' (pos 6)

How is that should be

path/to/execution.py:21: note: Revealed type is "def (id: builtins.str, df: Any, *, schema: Union[builtins.str, None] =) -> FooBarBaz"

System information

  • python version: 3.11.4

  • returns version: 0.21.0

  • mypy version: 1.6.1

  • pytest version (if any): 7.2.1

Lenguaje dominante
Python
Estrellas
4.4k
Forks
154
Merge medio
3 h 5 min
PR fusionados (30 d)
22

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dry-python/returns

Todos los issues de dry-python/returns

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.