Description of feature
Our deprecated isn’t integrated with our Settings docs: option: Annotated[int, Field(deprecated=...)] doesn’t result in a .. version-deprecated in the docs.
Once we have an answer in python/cpython#150076, we can change our API to just be a subclass of warnings.deprecated instead of having Deprecation, while still being able to specify version.
I’d recommend:
class deprecated(warnings.deprecated):
__init__(
# same as warnings.deprecated:
self, msg: LiteralString, *, category: type[Warning] = FutureWarning, stacklevel: int = 1,
# ours
version: str | Version, # still mandatory, could be renamed
version_removed: str | Version | None = None,
) -> None: ...
Description of feature
Our
deprecatedisn’t integrated with ourSettingsdocs:option: Annotated[int, Field(deprecated=...)]doesn’t result in a.. version-deprecatedin the docs.Once we have an answer in python/cpython#150076, we can change our API to just be a subclass of
warnings.deprecatedinstead of havingDeprecation, while still being able to specifyversion.I’d recommend: