decorators.py¶
Some decorators I expect to use regularly
-
decorators.abstractmethod(method)[source]¶ - Declare a method ‘abstract’ in something vaguely like the java sense
- for an abstract class or interface. Usage:
>>> @abstractmethod >>> def method_to_be_declared_abstract(): pass
-
decorators.progress_bar_runner(function, counter=0, linewidth=100, perdot=1, stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>)[source]¶ Decorate the execution of a loop with printed dots to indicate progress
function is a method that returns a boolean to indicate whether or not to continue. Standard while-loop semantics apply. True means continue, False means stop.