3 ms·
Although "if bar is None:" is the explicit form, the common idiomatic one is "if not bar:" (unless it's acceptable for bar to be 0).
by toyg 5y ago
Although "if bar is None:" is the explicit form, the common idiomatic one is "if not bar:" (unless it's acceptable for bar to be 0).
- dragonwriter 5y ago> unless it's acceptable for bar to be 0 Or an empty list. Or any other falsish value.