8 ms·
Then use better whitespace rules. Not to mention the helper isn't capturing any closure here so it's not particularly useful inline, and even when they are you
by bpicolo 11y ago
Then use better whitespace rules. Not to mention the helper isn't capturing any closure here so it's not particularly useful inline, and even when they are you can refactor variable capture to new functions. Nested definitions in python are pretty rare, and oft unnecessary
if __name__ == '__main__':
def this_is_a_function(*args, **kwargs):
def this_is_a_helper_function(
arg1,
arg2='this line is now indented 12 chars!'
):
this_long_variable = (
"Don't put an expression here unless you "
"want to use useless intermediate variabls."
)
return this_long variable if var else 'really short here'
return 1
- deleted 11y ago[deleted]
- JadeNB 11y agoSurely the fact that there are two typos in your code, one of them in the name of a variable (`this_long_variable` vs `this_long variable`), indicates that things can go wrong when you abstract out a literal to a variable?
- bpicolo 11y agoI literally copy pasted from the other guy and added whitespace.