python / python/cpython

Clarify `warnings.deprecated` public API

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

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

docs
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Documentation

The current docs only specify that it sets the __deprecated__ attribute on the deprecated item.

Pydantic relies on its full API: the fact that it’s a class, and that its instances have all passed parameters in attributes: deprecated(**kw).__dict__ == kw basically.

Two questions:

  1. Is that safe or might deprecated get e.g. refactored into a function at some point?
  2. Can we subclass it and add parameters? Will type checkers understand this and still mark a @our_deprecated_subclass(...) def ... as deprecated? See https://github.com/python/typing/issues/2256

maybe related to #138165

Linked PRs
  • gh-153879
  • gh-154487
  • gh-154488
  • gh-154489

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

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

はじめの一歩

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

調査の方向性

warnings.deprecated の現在のドキュメントから始め、リンクされている PR 153879、154487、154488、154489 を関連する issue 138165 と併せて読んでください。公開クラス、インスタンス属性、サブクラス化の動作、型チェッカーの想定をドキュメント化するか、合意された回答を記録すれば完了です。

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

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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