是否可以为方法编写包装函数?
>>> lowtide = [ 'oh', 'i', 'do', 'like', 'to', 'be', 'beside', 'the', 'seaside' ]
>>> [ x.capitalize() for x in lowtide ]
['Oh', 'I', 'Do', 'Like', 'To', 'Be', 'Beside', 'The', 'Seaside']
>>> list(map(lambda x: x.capitalize(), lowtide))
['Oh', 'I', 'Do', 'Like', 'To', 'Be', 'Beside', 'The', 'Seaside']
>>> def mef(m):
... def _mef(m,x):
... return x.m()
... return partial(_mef, m)
...
>>> list(map(mef(capitalize), lowtide))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'capitalize' is not defined