Home | Trees | Indices | Help |
---|
|
|
|||
|
|||
|
|||
|
|
|||
__package__ = None hash(x) |
|
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
|
Decorator for marking a method abstract. Throws a NotImplementedError if an abstract method is called. Usage: from grizzled.decorators import abstract class MyAbstractClass(object): @abstract def abstractMethod(self): pass class NotReallyConcrete(MyAbstractClass): # Class doesn't define abstractMethod(). Given the above declaration, the following code will cause an NotImplementedError: obj = NotReallyConcrete() obj.abstractMethod() |
Decorator for marking a function or method unimplemented. Throws a NotImplementedError if called. Note that this decorator is conceptually different from @abstract. With @abstract, the method is intended to be implemented by a subclass. With @unimplemented, the method should never be implemented. Usage: from grizzled.decorators import unimplemented class ReadOnlyDict(dict): @unimplemented def __setitem__(self, key, value): pass |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Mar 14 15:21:05 2016 | http://epydoc.sourceforge.net |