semi_cr.core package

Subpackages

Submodules

semi_cr.core.helpers module

semi_cr.core.helpers.deprecated(message)[source]

Mark a function as deprecated, warning on each call.

Use as a decorator factory: pass the message you want shown, and the decorated function will emit that message as a DeprecationWarning every time it is called, before running as normal.

Example::

@deprecated(“Use new_function() instead; removed in v3.0.”) def old_function():

Parameters:

message – The warning text shown when the decorated function is called. Include what to use instead and, if known, when the function will be removed.

Returns:

A decorator that wraps the target function. The wrapper preserves the original function’s name, docstring, and signature (via functools.wraps), and reports the warning against the caller’s line (stacklevel=2) so it’s easy to locate the offending usage.

Note

DeprecationWarning is hidden by default except in __main__ and under test runners such as pytest. This is intentional: the warning targets developers, not end users. If you need it visible everywhere, change the category to FutureWarning.

Module contents