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 Janusz Harkot
Recipients Janusz Harkot
Date 2018-05-18.15:19:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526656790.96.0.682650639539.issue33572@psf.upfronthosting.co.za>
In-reply-to
Content
using boolean (True/False) as dictionary keys, coerce them to integers - is this behavior documented somewhere?

I know that asking to fix this is not easy fix, but shouldn't this be highlighted everywhere with red flags and warnings, so people will know that this is expected?


Python 3.6.5 (default, Mar 29 2018, 03:28:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> dta = {False: 'false', True: 'true', 0: 'zero', 1: 'one'}
>>> print(dta[False])
zero
>>>
History
Date User Action Args
2018-05-18 15:19:50Janusz Harkotsetrecipients: + Janusz Harkot
2018-05-18 15:19:50Janusz Harkotsetmessageid: <1526656790.96.0.682650639539.issue33572@psf.upfronthosting.co.za>
2018-05-18 15:19:50Janusz Harkotlinkissue33572 messages
2018-05-18 15:19:50Janusz Harkotcreate