Message277860
| Author |
serhiy.storchaka |
| Recipients |
Demur Rumed, kayhayen, larry, ned.deily, python-dev, rhettinger, serhiy.storchaka, vstinner |
| 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 |
|