Open creamidea opened 10 years ago
(Let me think of Lisp, My dear lisp)
不知道问题是什么……
>>> from functools import partial
>>> basetwo = partial(int, base=2)
>>> basetwo.__doc__ = 'Convert base 2 string to an int.'
>>> basetwo('10010')
18
@au9ustine
嗯,其实这里的issue被我滥用了,这里也变成记笔记的地方了,不仅仅记录问题。
自问自答,自娱自乐:)
不过说来,python最大的好处是可读性比较好。函数式的功能不多,也足够用了。
Currying: partial function application PFA
举一个栗子: