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 deprecated get 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 How to extend warnings.deprecated? typing#2256
maybe related to #138165
Linked PRs
Reactions are currently unavailable
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:
maybe related to #138165
Linked PRs