Closed ulope closed 8 years ago
@ulope That's a good point. I can probably just tweak the example slightly to make this optimization impossible. For example, have it return len(response["data"])
, rather than returning response["data"]
; the len
call would fail on NoneType
. Then the function would be one that returns None
if response["data"]
is missing or empty, and returns its length (int > 0) if it is present and has items.
The "good" example for "Flat is better than nested" could be optimized to:
But since the goal is probably to demonstrate the merged conditions another example would probably be better.