Re:Strict Python function parameters
by toyg on Sunday January 23, 2022 @11:44AM
(#30047622)
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).
[ Parent
| on HN ]
Re:Strict Python function parameters
by dragonwriter on Sunday January 23, 2022 @03:36PM
(#30050186)
> unless it's acceptable for bar to be 0
Or an empty list.
Or any other falsish value.