py3中reduce
前因
因为 Guido 先生讨厌 reduce。(Because Guido hates it. )
详细过程请翻阅原文:http://www.artima.com/forums/flat.jsp?forum=106&thread=98196
Guido大大原计划把 lambda, reduce 都干掉。
最后只干掉了 reduce
使用
首先在python3版本中,直接使用reduce()的话,系统会报错,提示不存在reduce()函数。
在Python 3里,reduce() 函数已经被从全局名字空间里移除了,它现在被放置在fucntools 模块里


浙公网安备 33010602011771号