Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
- Type "copyright", "credits" or "license()" for more information.
- >>> funcs = []
- >>> def decorator(function):
- funcs.append(function)
- >>> @decorator
- def function(): print "function"
- >>> function()
- Traceback (most recent call last):
- File "<pyshell#7>", line 1, in <module>
- function()
- TypeError: 'NoneType' object is not callable
- >>> funcs[0]()
- function
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement