[New-bugs-announce] [issue19663] Not so correct error message when initializing defaultdict

Vajrasky Kok report at bugs.python.org
Wed Nov 20 17:25:45 CET 2013


New submission from Vajrasky Kok:

>>> from collections import defaultdict
>>> defaultdict('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: first argument must be callable
>>> defaultdict(None)
defaultdict(None, {})
>>> None()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable

After patch:

>>> from collections import defaultdict
>>> defaultdict('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: first argument must be callable or None

----------
components: Extension Modules
files: fix_error_message_default_dict.patch
keywords: patch
messages: 203500
nosy: rhettinger, vajrasky
priority: normal
severity: normal
status: open
title: Not so correct error message when initializing defaultdict
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32722/fix_error_message_default_dict.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19663>
_______________________________________


More information about the New-bugs-announce mailing list