Message5199

Author andresmoreira
Recipients andresmoreira
Date 2009-09-28.17:42:24
SpamBayes Score 1.1616405e-06
Marked as misclassified No
Message-id <1254159744.93.0.132304109826.issue1478@psf.upfronthosting.co.za>
In-reply-to
Content
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)
>>>
History
Date User Action Args
2009-09-28 17:42:25andresmoreirasetrecipients: + andresmoreira
2009-09-28 17:42:24andresmoreirasetmessageid: <1254159744.93.0.132304109826.issue1478@psf.upfronthosting.co.za>
2009-09-28 17:42:24andresmoreiralinkissue1478 messages
2009-09-28 17:42:24andresmoreiracreate