pythonwrench.warnings module

pythonwrench.warnings.deprecated_alias(alternative: ~typing.Callable[[__SPHINX_IMMATERIAL_TYPE_VAR__P_P], __SPHINX_IMMATERIAL_TYPE_VAR__V_U], msg_fmt: str = "Deprecated call to '{fn_name}', use '{alternative_name}' instead.", warn_fn: ~typing.Callable[[str], ~typing.Any] = functools.partial(<functools._lru_cache_wrapper object>, category=<class 'DeprecationWarning'>)) Callable[[...], Callable[[P], U]][source]

Decorator to wrap deprecated function aliases.

pythonwrench.warnings.deprecated_function(fn: None = None, /, *, msg_fmt: str = "Deprecated call to '{fn_name}'.", warn_fn: Callable[[str], Any] = partial(warn_once, category=DeprecationWarning)) Callable[[Callable[[P], U]], Callable[[P], U]][source]
pythonwrench.warnings.deprecated_function(fn: Callable[[P], U], /, *, msg_fmt: str = "Deprecated call to '{fn_name}'.", warn_fn: Callable[[str], Any] = partial(warn_once, category=DeprecationWarning)) Callable[[P], U]

Decorator to wrap deprecated functions.

pythonwrench.warnings.warn_once(message: str, category: type[Warning] | None = None, stacklevel: int = 1, source: Any = None) None[source]
pythonwrench.warnings.warn_once(message: Warning, category: Any = None, stacklevel: int = 1, source: Any = None) None

Warn message once using warnings module.