--
来自: python-cn`CPyUG`华蟒用户组(中文Python技术邮件列表)
发言: pyth...@googlegroups.com
退订: python-cn+...@googlegroups.com (向此发空信即退!)
详情: http://code.google.com/p/cpyug/wiki/PythonCn
严正: 理解列表! 智慧提问! http://wiki.woodpecker.org.cn/moin/AskForHelp
l=map(lambda x:do_some_func,list_)
for i in l :
x=list(l)
map( lambda x:x+1,l) # slower than [i+1 for i in x]
至于你的这个所谓的性能测试,没有任何意义。这点性能的差别,不是因为map,是因为int和str的区别。
lazy有lazy的好处。
import itertools
seed = itertools.count()
f = map(lambda x : pow(x, 2), seed)
for i in f:
if i >= 100:
break
print(i)
> >>> 退订: python-cn+...@googlegroups.com<python-cn%2Bunsu...@googlegroups.com>(向此发空信即退!)
> >>> 详情: http://code.google.com/p/cpyug/wiki/PythonCn
> >>> 严正: 理解列表! 智慧提问! http://wiki.woodpecker.org.cn/moin/AskForHelp
> >>>
> >>
> >>
> > --
> > 来自: python-cn`CPyUG`华蟒用户组(中文Python技术邮件列表)
> > 发言: pyth...@googlegroups.com
> > 退订: python-cn+...@googlegroups.com<python-cn%2Bunsu...@googlegroups.com>(向此发空信即退!)
> > 详情: http://code.google.com/p/cpyug/wiki/PythonCn
> > 严正: 理解列表! 智慧提问! http://wiki.woodpecker.org.cn/moin/AskForHelp
> >
>
>
>
> --
> Alexander.Li
> +86 15308006505
> mail: superp...@gmail.com/superp...@hotmail.com
> site:http://alexander-lee.cnblogs.com
>
qq and sogou all have cloud input written in AJAX, you got input
method provide that you have a decent web-browser.