Author serhiy.storchaka
Recipients Demur Rumed, haypo, kayhayen, larry, ned.deily, python-dev, rhettinger, serhiy.storchaka
Date 2016-10-02.08:37:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475397477.48.0.468257215173.issue28257@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch with smaller (in comparison with issue27358) change for 3.5 that improves error message when pass a non-mapping as second var-keyword argument.

Unpatched:

>>> f(**{'a': 1}, **[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not a mapping
>>> f(**{'a': 1}, **0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable

Patched:

>>> f(**{'a': 1}, **[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() argument after ** must be a mapping, not list
>>> f(**{'a': 1}, **0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() argument after ** must be a mapping, not int
History
Date User Action Args
2016-10-02 08:37:57serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, haypo, larry, ned.deily, kayhayen, python-dev, Demur Rumed
2016-10-02 08:37:57serhiy.storchakasetmessageid: <1475397477.48.0.468257215173.issue28257@psf.upfronthosting.co.za>
2016-10-02 08:37:57serhiy.storchakalinkissue28257 messages
2016-10-02 08:37:57serhiy.storchakacreate