Clarify `warnings.deprecated` public API
Open
Nobody has claimed this yet.
docs
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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:
- Is that safe or might
deprecatedget e.g. refactored into a function at some point? - 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the current documentation for warnings.deprecated, then read linked PRs 153879, 154487, 154488, and 154489 alongside related issue 138165. Done means documenting the public class, instance attributes, subclassing behavior, and type-checker expectations, or recording the agreed answers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100