Evaluation of Truth Curiosity
MonkeeSage
MonkeeSage at gmail.com
Thu Sep 21 05:04:02 EDT 2006
James Stroud wrote:
> What is the logic of the former expression not evaluating to True (or
> why the latter not 1?)? Is there some logic that necessitates the first
> operand's dictating the result of the evaluation? Or is this an artefact
> of the CPython implementation?
If I understand correctly, OR'ing an int and a bool (your first
example) returns an int by coercing the bool to an int; and OR'ing two
bools (your second example) returns a bool.
Regards,
Jordan
More information about the Python-list
mailing list