浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理


你的OS是64位,但你的python是32位的。你试试看import sys; print sys.maxint,看看是不是2147483647就知道了。
python里dict的entry是放在一个连续的数组里的。在32位的python里,这个数组的最大长度大概就在44739243左右。

除了换python的版本以外,你还可以想一些workaround,比如,申请16个dict,以k % 16的结果决定放在哪个字典里

 

i test this also on my 64bit version win7 and ubuntu lucid 64bit

on my win 7 i install activestate py2.7 which return the 2147483647

 

on my ubuntu returend 9223372036854775807

posted on 2012-04-01 15:26  lexus  阅读(917)  评论(0编辑  收藏  举报