[Python-ideas] dictionary constructor should not allow duplicate keys

Random832 random832 at fastmail.com
Tue May 3 22:44:08 EDT 2016


On Tue, May 3, 2016, at 22:22, Chris Angelico wrote:
> Whether constants get folded before this check, and whether {1:'x',
> 1.0:'y'} causes an error, can be implementation-defined.

For *general* constant folding, maybe, but what's the point of having it
if it doesn't apply to negative numbers and nonimaginary complex
numbers? How about tuple displays consisting of only numeric and string
literals, empty tuple displays, and tuple displays which themselves
satisfy this definition?


More information about the Python-ideas mailing list