[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
Andy Maier added the comment: 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 "", line 1, in ValueError: dictionary update

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: This isn't a bug because the MappingProxy doesn't promise to do early detection and because it can't really be accomplished cleanly. Perfect detection of non-mappings isn't possible. Some easy, minimal checks are made for early detection using

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
Change by Andy Maier : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
New submission from Andy Maier : MappingProxyType objects can currently be initialized from a string object. Given is purpose, I think this is a bug and should result in TypeError being raised. Example code (on CPython 3.9.1): >>> from types import MappingProxyType >>> mp =