Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Incorrect result type for `returns.curry.partial` with keyword arguments for positional parameters

オープン
#2,191 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
devtools

調査の方向性

returns.curry.partial エントリポイントから開始し、Python 3.13.4、returns 0.25.0、mypy 1.15.0 を使って foo の例で問題を再現してください。キーワードで部分適用された位置引数パラメーターが、残りのパラメーターをキーワード専用とする型を生成し、位置引数での使用が型チェックによって拒否されれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Bug report

What's wrong

When using returns.curry.partial, if you partially apply a positional parameter using a keyword argument, the resulting type is incorrect. Result type of callable allows passing the remaining arguments as positional, but this leads to a runtime error.

Example
def foo(x: int, y: int) -> None:
    ...

bar = returns.curry.partial(foo, x=1)
reveal_type(bar)
# => Mypy: "def (y: builtins.int)"
# => Expected: "def (*, y: builtins.int)"

bar(2)
# No errors from mypy, but got runtime error
# TypeError: foo() got multiple values for argument 'x'

How is that should be

In this scenario, the remaining parameters should be strictly keyword-only. The resulting type should reflect this restriction, and passing a positional argument should be flagged as an error at type checking time.

System information

  • python version: 3.13.4
  • returns version: 0.25.0
  • mypy version: 1.15.0
主要言語
Python
スター
4.4k
フォーク
154
平均マージ
3時間 5分
マージ済み PR(30日)
22

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dry-python/returns のほかの issue

dry-python/returns の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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