3 ms·
null (or None) is still a valid Falsey value, and in both examples isDone will be a boolean (strict) value, as it is the result of a boolean operation (and). S
by coldtea 7y ago
null (or None) is still a valid Falsey value, and in both examples isDone will be a boolean (strict) value, as it is the result of a boolean operation (and).
So the point of the comment is moot...
- avip 7y agoNot the case in any of the abovementioned languages.
- detaro 7y agoJS: undefined && undefined -> undefined Python: None and None -> None
- Izkata 7y agoOn top of that, truthy values also propagate, so if isDelivered or isNotified are something else that's truthy (such as a 1 from mysql), isDone will not be True either and risk failing in more interesting ways down the line.