by zo1 · 11y ago · 0 comments
Indeed, that is one of those "big argument" type of minor formatting discussions. Despite my OCD, it doesn't bother me, and in fact, I prefer formatting them as below:
some_dict = {
'a_key': an_expression,
'another_key': another_expression,
}
Question, if you add another entry, and it throws off the formatting, do you go up and change all the other entries prior so they all align? Because that does bring up questions about code-commits. I.e. you're touching code that hasn't changed. some_dict = {
'a_key': an_expression,
'another_key': another_expression,
'a_really_long_key_that_throws_you_off': expression,
}
As opposed to: some_dict = {'a_key': an_expression,
'another_key': another_expression,
'a_really_long_key_that_throws_you_off': expression}Would be cool if IDEs could do this for you at the display level without touching the underlying code!