This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class countCalls(object): | |
"""Decorator that keeps track of the number of times a function is called. | |
:: | |
>>> @countCalls | |
... def foo(): | |
... return "spam" | |
... | |
>>> for _ in range(10) | |
... foo() |
NewerOlder