Hacker News new | ask | show | jobs
by jabiko 458 days ago
I think you are making a good point but if this function is only used in one place I would personally prefer to just use a variable:

    something_is_valid = something > 0 and something != foo and something > bar

    if something_is_valid:
        # do stuff
That way you can document the intention of the condition using the variable name while at the same time keeping the locality of the check.