A bit weird dictionary behavior

Grzegorz Staniak gstaniak at wp.pl
Mon Sep 22 18:12:02 EDT 2008


On 22.09.2008, Carl Banks <pavlovevidence at gmail.com> wroted:

>> >> but it still doesn't feel exactly right. Would it be worth submitting a bug?
>>
>> > It feels wrong because it is. In a tidier language (Pascal, Java, etc)
>> > a boolean and an integer must be different types.
>>
>> Some would argue (and some did by the time Python grew a 'bool' type)
>> that what is wrong is to have a bool type in a language that already
>> have a wider definition of the truth value of an expression...
>
> And some would argue that it was wrong to have such a wide definition
> for the truth value of an expression in the first place...

Just out of idle curiosity, what could be the alternatives? Not to evaluate 
e.g. strings to "true"? Aren't such conventions as "whatever is not empty,
is 'true'" popular in dynamic langauges?

GS
-- 
Grzegorz Staniak <gstaniak _at_ wp [dot] pl>
Nocturnal Infiltration and Accurate Killing



More information about the Python-list mailing list