码迷,mamicode.com
首页 > 其他好文 > 详细

py3中reduce

时间:2019-04-01 13:03:32      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:ref   thread   guid   amp   计划   read   for   blog   com   

前因

因为 Guido 先生讨厌 reduce。(Because Guido hates it. )

详细过程请翻阅原文:http://www.artima.com/forums/flat.jsp?forum=106&thread=98196

Guido大大原计划把 lambdareduce 都干掉。

最后只干掉了 reduce

使用

首先在python3版本中,直接使用reduce()的话,系统会报错,提示不存在reduce()函数。

在Python 3里,reduce() 函数已经被从全局名字空间里移除了,它现在被放置在fucntools 模块里

技术图片

 

py3中reduce

标签:ref   thread   guid   amp   计划   read   for   blog   com   

原文地址:https://www.cnblogs.com/hnlmy/p/10635705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!