python / python/typeshed

numbers module

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

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

stubs: incomplete
主要言語
Python
スター
5.1k
フォーク
2.1k
平均マージ
1日 19時間
マージ済み PR(30日)
82

説明

image
The signature of Rational.__truediv__ is marked as the following:
image
First of, _ComplexLike sounds like it should be numbers.Complex. But second, the signature should be more refined :

  • the divisor cannot be just any value, it has to be a number, so at a minimum numbers.Complex instead of Unknown. The typing signature should be (self, Complex) -> Complex.
  • when passing a Real as a divisor, the result cannot have an imaginary part and must be Real too. I'd go as far as saying that a Rational divisor would yield a Rational dividend. In any case, a (self, Real) -> Real overload should be defined. And as a bonus, a (self, Rational) -> Rational one too.

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

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

はじめの一歩

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

調査の方向性

typeshed の numbers モジュールから始めて、Rational.truediv の宣言を調べます。現在の _ComplexLike および Unknown のアノテーションを、要求された Complex、Real、Rational のオーバーロードと比較します。スタブが要求された除数と結果の関係を表現し、関連する typeshed の検証に合格すれば完了です。

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

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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