[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

R. David Murray report at bugs.python.org
Mon Apr 21 16:49:34 CEST 2014


R. David Murray added the comment:

2.7 can't be changed for backward compatibility reasons, and python3 enforces the restriction in dict, as you observe.

I don't know if a python2 documentation note is worthwhile, but given the conversations at pycon about adding additional -3 warnings to 2.7, it seems like this is a place such a warning would be justified.

----------
nosy: +r.david.murray
stage:  -> needs patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21320>
_______________________________________


More information about the Python-bugs-list mailing list