There is a bug in python dictionaries The following dictionary { 1: 'first yolo', True: 'second yolo' } returns { 1: 'second yolo' }
Tested on python 3.8.3 and python 3.9.0. Both have same issue
Some other statements below that might help see the problem
print({ 1: 'yolo', 10: 2.2 }) print({ 1: 'yolo', 10: 2.2, True: False }) print({ 1: 'yolo', True: False }) print({ 1: 'first yolo', True: 'second yolo' })
This is not a bug. The value True in Python is, in fact, equal to 1. Also, the PEPs repository isn't the right place to discuss this sort of thing - I recommend the python-list mailing list.
Activity
Rosuav commented on Dec 27, 2020
This is not a bug. The value True in Python is, in fact, equal to 1. Also, the PEPs repository isn't the right place to discuss this sort of thing - I recommend the python-list mailing list.