scverse_misc.deprecated#

class scverse_misc.deprecated(msg, *, category=<class 'FutureWarning'>, stacklevel=1)#

Decorator to indicate that a class, function, or overload is deprecated.

Wraps warnings.deprecated(). If the scverse_misc Sphinx extension is enabled, the function’s documentation will include a deprecation notice.

Parameters:
  • msg (Deprecation) – The deprecation message.

  • category (type[Warning] (default: <class 'FutureWarning'>)) – The category of the warning that will be emitted at runtime.

  • stacklevel (int (default: 1)) – The stack level of the warning.

Examples

>>> @deprecated(Deprecation("0.2", "Use bar() instead."))
... def foo(baz):
...     pass

Attributes#

deprecated.message: Deprecation#

Methods#

deprecated.__call__(func)#

Call self as a function.

Return type:

TypeVar(F)