Undocumented method for "slice" class

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
documentation

調査の方向性

issue にリンクされている slice クラスの Python ドキュメントページから始め、メソッドがどのようにドキュメント化されているかを確認します。length 引数、返されるタプル、動作例を含めて slice.indices() のドキュメントを追加します。クラスと並べてこのメソッドが説明され、例が正確であれば完了です。

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

説明

docs

Documentation

The "slice" class has a method "indices" that, when given a length of a sequence, will return a tuple with (start, stop, step) that is adjusted for the length of that sequence. This method is completely undocumented

For example,

x=slice(0, 10, -2)
x.indices(5) #This returns (0, 4, -2)
x.indices(10) #This returns (0, 9, -2)
x.indices(100) #This returns (0, 9, -2)

The only example that I could find in any official Python documents is this, there is a single reference to this method at the bottom of the page. However, as of the lastest version of Python, which is 3.11.0 at the time of writing, using this method in a standard installation of CPython still works.

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

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

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

はじめの一歩

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

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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