Message391036
I accept that the issue was closed, but wanted to document some things:
1. The dict class manages very well to detect that a string is invalid input:
>>> d = dict('abc')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: dictionary update sequence element #0 has length 1; 2 is required
2. When initialized with strings, it looses some of its dictionary methods, but does a quite reasonable job in pointing that out in the error message:
>>> mp = MappingProxyType('abc')
>>> mp.items()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'items' |
|
Date |
User |
Action |
Args |
2021-04-14 05:48:35 | andymaier | set | recipients:
+ andymaier, rhettinger |
2021-04-14 05:48:35 | andymaier | set | messageid: <1618379315.45.0.545760273123.issue43828@roundup.psfhosted.org> |
2021-04-14 05:48:35 | andymaier | link | issue43828 messages |
2021-04-14 05:48:35 | andymaier | create | |
|