将列表理解与psyco一起使用会适得其反。
此代码:
count = 0 for l in sys.stdin: count += not int(l)%k
跑的速度是原来的两倍
count = sum(not int(l)%k for l in sys.stdin)
使用psyco时。