Issue1478

classification
Title: defaultdict & weakref.WeakKeyDictionary [TypeError: first argument must be callable]
Type: crash Severity: normal
Components: Library Versions: 2.5.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: andresmoreira, fwierzbicki, pjenvey
Priority: Keywords:

Created on 2009-09-28.17:42:24 by andresmoreira, last changed 2009-10-01.01:13:21 by pjenvey.

Messages
msg5199 (view) Author: Andres Moreira (andresmoreira) Date: 2009-09-28.17:42:24
I've found this error trying to using WeakKeyDictionary as default value
of the defaultdict. 
It's strange because the WeakKeyDictionary is callable as callable
function said it, but not callable for defaultdict.


Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_16
>>> import weakref
>>> weakref.WeakKeyDictionary
<class weakref.WeakKeyDictionary at 0x1>
>>> callable(weakref.WeakKeyDictionary)
True
>>> from collections import defaultdict
>>> d = defaultdict(weakref.WeakKeyDictionary) 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: first argument must be callable
>>> d = defaultdict(int)
>>>
msg5209 (view) Author: Philip Jenvey (pjenvey) Date: 2009-10-01.01:13:21
fixed in r6816
History
Date User Action Args
2009-10-01 01:13:21pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg5209
2009-09-28 21:32:08pjenveysetassignee: pjenvey
nosy: + pjenvey
2009-09-28 17:46:38fwierzbickisetnosy: + fwierzbicki
2009-09-28 17:42:24andresmoreiracreate