AFAIK :
and, or are boolean operators and any boolean expression should return a boolean.
So, why does this happens :
False or 'name'returns'name'and notTrueTrue and ''returns''and notFalse
Please explain, how does python handles boolean expressions ?
No, in python the
orandandoperations short circuit and return the last evaluated item.See Boolean operations:
If you must have a boolean value, use
bool():