Collin Funk wrote:
> I'm used to writing this:
> 
> if value:
>     print('1')
> else:
>     print('2')
> 
> instead of this:
> 
> if value == True:
>     print('1')
> elif value == False:
>     print('2')

If the variable has 2 possible values, then writing 'if value:' is the
simpler way of writing things.

If the variable has 3 possible values (None, False, True), then writing
'if value == True:' is the simpler way. Why would one use a conversion to
bool, i.e. 3-values to 2-values conversion? It would only make things
more complicated.

Bruno




Reply via email to