消息 [113801]
For some reason, sys.modules['heapq'] contains the Python implementation instead of the C implementation.
Tested with r83981 on python 3:
Python 3.2a1+ (py3k:83981M, Aug 13 2010, 19:02:31)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import heapq
>>> heapq.heappop(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/florent/dev/python/py3trunk/Lib/heapq.py", line 140, in heappop
lastelt = heap.pop() # raises appropriate IndexError if heap is empty
AttributeError: 'int' object has no attribute 'pop'
>>> import _heapq
>>> _heapq.heappop(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: heap argument must be a list
These tests (TestErrorHandling) are supposed to run with the C module only. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2010-08-13 17:49:12 | flox | 修改 | recipients:
+ flox, pitrou, vstinner |
| 2010-08-13 17:49:11 | flox | 修改 | messageid: <1281721751.97.0.668278807249.issue9589@psf.upfronthosting.co.za> |
| 2010-08-13 17:49:10 | flox | 链接 | issue9589 messages |
| 2010-08-13 17:49:09 | flox | 创建 | |
|