MCPcopy Create free account
hub / github.com/celery/celery / Callable

Function Callable

celery/utils/deprecated.py:36–62  ·  view source on GitHub ↗

Decorator for deprecated functions. A deprecation warning will be emitted when the function is called. Arguments: deprecation (str): Version that marks first deprecation, if this argument isn't set a ``PendingDeprecationWarning`` will be emitted instead.

(deprecation=None, removal=None,
             alternative=None, description=None)

Source from the content-addressed store, hash-verified

34
35
36def Callable(deprecation=None, removal=None,
37 alternative=None, description=None):
38 """Decorator for deprecated functions.
39
40 A deprecation warning will be emitted when the function is called.
41
42 Arguments:
43 deprecation (str): Version that marks first deprecation, if this
44 argument isn't set a ``PendingDeprecationWarning`` will be
45 emitted instead.
46 removal (str): Future version when this feature will be removed.
47 alternative (str): Instructions for an alternative solution (if any).
48 description (str): Description of what's being deprecated.
49 """
50 def _inner(fun):
51
52 @wraps(fun)
53 def __inner(*args, **kwargs):
54 from .imports import qualname
55 warn(description=description or qualname(fun),
56 deprecation=deprecation,
57 removal=removal,
58 alternative=alternative,
59 stacklevel=3)
60 return fun(*args, **kwargs)
61 return __inner
62 return _inner
63
64
65def Property(deprecation=None, removal=None,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected