pyufunc.end_of_life#

pyufunc.end_of_life(func_or_class=None, **kwargs)#

A decorator to mark the end of life of a function or class method. It’s useful to use this function to remind users to avoid using the deprecated functions.

Parameters:
  • func_or_class – the function or class method to be decorated.

  • kwargs – the optional arguments, including message. message(str): the additional message to the users. msg(str): the additional message to the users.

Examples

>>> from pyufunc import end_of_life
>>> @end_of_life
>>> def my_func():
>>>    return "I'm running!"
>>> my_func()
>>> :Warning: my_func is deprecated and will be removed in the future.
>>> I'm running!
>>> @end_of_life(message="Please use the new function instead.")
>>> def my_func():
>>>    return "I'm running!"
>>> my_func()
>>> :Warning: my_func is deprecated and will be removed in the future.
>>> :Please use the new function instead.
>>> I'm running!
Returns:

the decorated function.

Return type:

object