How to extend `warnings.deprecated`?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 302
- Avg merge
- 23h
- Merged PRs (30d)
- 8
Description
We need more metadata for our deprecation decorator, but the spec doesn’t say how deprecated marks an API. So the only way to mark something as deprecated it is by creating an API with the same exact signature and replace it with warnings.deprecated at the type level:
if TYPE_CHECKING:
from warnings import deprecated
else:
def deprecated[F](msg: str) -> Callable[[F], F]: ...
We need to define deprecated(msg: str, version: packaging.Version) and have it work with the type system. How?
Contributor guide
No contributing guide indexed for this repository
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 issue's warnings.deprecated and TYPE_CHECKING examples, then review how the typing specification represents deprecation metadata and decorator signatures. Done means reaching an agreed design for accepting packaging.Version metadata while preserving correct type-system behavior; the issue does not name a specific file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100