We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8300928 commit 2efc220Copy full SHA for 2efc220
2 files changed
decorator.py
@@ -1,24 +1,27 @@
1
-'''https://docs.python.org/2/library/functools.html#functools.wraps'''
2
-'''https://stackoverflow.com/questions/739654/how-can-i-make-a-chain-of-function-decorators-in-python/739665#739665'''
+"""https://docs.python.org/2/library/functools.html#functools.wraps"""
+"""https://stackoverflow.com/questions/739654/how-can-i-make-a-chain-of-function-decorators-in-python/739665#739665"""
3
4
from functools import wraps
5
6
+
7
def makebold(fn):
8
@wraps(fn)
9
def wrapped():
10
return "<b>" + fn() + "</b>"
11
return wrapped
12
13
14
def makeitalic(fn):
15
16
17
return "<i>" + fn() + "</i>"
18
19
20
21
@makebold
22
@makeitalic
23
def hello():
- '''a decorated hello world'''
24
+ """a decorated hello world"""
25
return "hello world"
26
27
if __name__ == '__main__':
prototype.py
@@ -23,6 +23,7 @@ def clone(self, name, **attr):
obj.__dict__.update(attr)
return obj
class A:
28
def __init__(self):
29
self.x = 3
0 commit comments