Re:Google Python Style Guide
by gorgoiler on Saturday February 11, 2023 @08:49AM
(#34752275)
You are right — the return thing is very silly. What about this:
def greet(…, bow=False):
…
if bow:
take_a_bow()
Except imagine take_a_bow() instead as 10 lines of code to perform the post-greeting bow-ceremony. That code takes additional arguments regarding what kind of hand flourish to perform while bowing. The flourish_type has to be an optional argument to greet (because bow is) but inside the bow you have to assert flourish_type is not None because you can’t bow without knowing what flourish to give.
I’ve seen some dark stuff over the years.
Also: Welcome to HN!