Use Argument Clinic for more functions and methods
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Many functions and methods implemented in C still parse their arguments with PyArg_ParseTuple() or PyArg_UnpackTuple().
They have no signature for introspection and use the slow METH_VARARGS calling convention.
There are 131 such PyMethodDef entries outside the test modules: _curses 25, _ctypes 16, _interpchannels 13 (GH-139141), time 11, _io 9, _tkinter 8, _thread 6, _csv 5, socket 3, sys 3, and 32 more in 27 files.
A few of them cannot be converted: the behaviour of socket.sendto(), socket.setsockopt() and socket.ioctl() depends on the number or the value of the arguments, and Argument Clinic rejects module-level __getattr__() as a special method.
I am going to submit a separate PR per module.
Linked PRs
- gh-155511
- gh-155512
- gh-155513
- gh-155514
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、一覧に挙げられたモジュールに残っている PyMethodDef エントリと、CPython ですでに使用されている Argument Clinic の規約を確認します。socket.sendto()、socket.setsockopt()、socket.ioctl()、およびモジュールレベルの getattr() は除外します;対象となる関数とメソッドが、指定された解析および呼び出し規約ではなく Argument Clinic を使用すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, python
- 領域
- backend, tooling
- issue の種類
- リファクタリング
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100