deprecated(since=None,
message=None)
|
|
Decorator for marking a function deprecated. Generates a warning on
standard output if the function is called.
Usage:
from grizzled.decorators import deprecated
class MyClass(object):
@deprecated()
def oldMethod(self):
pass
Given the above declaration, the following code will cause a
warning to be printed (though the method call will otherwise succeed):
obj = MyClass()
obj.oldMethod()
You may also specify a since argument, used to display a deprecation
message with a version stamp (e.g., 'deprecated since ...'):
from grizzled.decorators import deprecated
class MyClass(object):
@deprecated(since='1.2')
def oldMethod(self):
pass
- Parameters:
since (str) - version stamp, or None for none
message (str) - optional additional message to print
|