Hi,
Suppose we have a dict
Dic = { True: 'yes', 1: 'No'}
According to the Python 3 documentation, the keys must have a unique value
so True is converted to integer because of the type coercion (boolean are
subtype of integer) so boolean are winded to integer to be compared.
Am I missing somethin
On 11May2016 14:00, khalil zakaria Zemmoura wrote:
Suppose we have a dict
Dic = { True: 'yes', 1: 'No'}
According to the Python 3 documentation, the keys must have a unique value
so True is converted to integer because of the type coercion (boolean are
subtype of integer) so boolean are winded
On Wed, May 11, 2016 at 02:00:47PM +0100, khalil zakaria Zemmoura wrote:
> Hi,
>
> Suppose we have a dict
> Dic = { True: 'yes', 1: 'No'}
>
> According to the Python 3 documentation, the keys must have a unique value
> so True is converted to integer because of the type coercion (boolean are
> su
Steven D'Aprano wrote:
> On Wed, May 11, 2016 at 02:00:47PM +0100, khalil zakaria Zemmoura wrote:
>> Hi,
>>
>> Suppose we have a dict
>> Dic = { True: 'yes', 1: 'No'}
>>
>> According to the Python 3 documentation, the keys must have a unique
>> value so True is converted to integer because of th