regarding the `consider-ternary-expression`
if condition():
x = 4
else:
x = 5
allow me to put fck'n breakpoints - in this case the expression is dumb, but what if is some complex stuff? x = 4 if condition() else 5
is cute, but - remember, kids - not everything* should be an expressionregarding the `while-used`, while I personally prefer the legibility of the `for` loop, I find the following paragraph... at best wrong:
>>> A while loop introduces unbounded computation. Do you really need unbounded computation for your boring web app? I doubt it. In almost all cases, the loop can be bounded in advance, as in “do this N times” or “do this for every item in this list”. Those kinds of loops are guaranteed to terminate, and that’s a nice guarantee to have.
in python `for` loop are equally unbounded as `while` ones. Yes, most of the time you are looping over a (finite) list or a (finite) dict, but the concept underlying the `for` loop is the iterator, not the list. And iterators can easily be infinite.