This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andymaier
Recipients andymaier, rhettinger
Date 2021-04-14.05:48:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618379315.45.0.545760273123.issue43828@roundup.psfhosted.org>
In-reply-to
Content
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'
History
Date User Action Args
2021-04-14 05:48:35andymaiersetrecipients: + andymaier, rhettinger
2021-04-14 05:48:35andymaiersetmessageid: <1618379315.45.0.545760273123.issue43828@roundup.psfhosted.org>
2021-04-14 05:48:35andymaierlinkissue43828 messages
2021-04-14 05:48:35andymaiercreate