[pypy-issue] [issue953] defaultdict behaviour inconsistent with cpython

mikefc tracker at bugs.pypy.org
Mon Dec 5 12:39:41 CET 2011


mikefc <coolbutuseless at gmail.com> added the comment:

I'm currently looking at cpython source to see if I can figure what they do.  
Output for both pythons included below.

================
cpython2.7.2
>>> defaultdict(dict)
defaultdict(<type 'dict'>, {})
>>> defaultdict({})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: first argument must be callable

===============
pypy1.7
>>>> defaultdict(dict)
defaultdict(<type 'dict'>, {})
>>>> defaultdict({})
defaultdict(None, {})

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue953>
________________________________________


More information about the pypy-issue mailing list