You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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__ == kwbasically.Two questions:
deprecatedget e.g. refactored into a function at some point?@our_deprecated_subclass(...) def ...as deprecated? See How to extendwarnings.deprecated? typing#2256maybe related to #138165