python / python/cpython

Consider cleanup of type for iterator variables bounded by asdl_seq_LEN

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

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

type-refactor
主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

説明

Feature or enhancement

It looks like the asdl_seq_LEN macro's "return type" is Py_ssize_t. Throughout the code, the type of the variable compared against a value "returned" by the macro are variously

int or
Py_ssize_t

Pitch

I am not sure, but it seems like it would be good to be consistent throughout the code base. If this is something that seems reasonable or valuable, I would be happy to take on the task!

Previous discussion

No previous discussion, however I searched prior issues and see nothing noting something similar.

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

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

はじめの一歩

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

調査の方向性

まず、asdl_seq_LEN マクロを見つけ、その結果とイテレータ変数を比較している使用箇所を確認します。int または Py_ssize_t 型の影響を受ける変数を特定し、コードベース全体で型を一貫させた後、関連する既存のテストを確認します。

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

評価

技術スタック
c
領域
backend
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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