2.14 True/False Evaluations
Use the “implicit” false if at all possible.
This one is my personal bug-bear. I find this: if not users:
...
significantly worse than: if users == []:
...
The second is totally explicit, reminds the reader that users is (expected to be) a list and makes it totally clear that we can only enter the conditional block if users is an empty list. if users == {}:
if users == 0:
if users is None:
if users == ():
if users is False:
Why is the implicit: if not users:
an improvement in any of these cases? If you need to distinguish False from None then chain the expressions, such as if not x and x is not None:.
!!! if x is False:
?
You were right the first time. Climbing is a largely constrained problem solving exercise with binary outcomes (you either did the route or didn't) and a built-in level-up style progression in the grading system. (Today I did my fist V2! etc...) You can do it entirely on your own, at your own time, in your own pace and it's not really possible to "lose" at climbing[1], you get unlimited attempts to try and figure it out. You can, for outdoor climbs, try the climb, fail, train for 6 months and retry the climb to succeed. In short it's almost designed to be addictive to coder types, but all that came before the indoor walls, not after.
Source: I climb obsessively. They got me good.
[1] - competition climbing aside, obviously