amontalenti/elements-of-python-style

To consider: multi-line list / tuple / dict formatting

amontalenti opened this issue · 1 comments

I think this should be one for "Six of One, Half a Dozen of the Other". Lots of people like doing various indentation styles for this, e.g.

file_formats = [
  "xls",
  "doc",
  "pdf"]

vs

file_formats = ["xls", 
                "doc", 
                "pdf"]

vs the much plainer single-line variant. And then, of course, there are people who really like trailing commas and moving the ending brace to its own line, for the purposes of making useless diffs less common:

file_formats = [
  "xls",
  "doc",
  "pdf",
]

I think these are one of the debates we'll choose not to care about. I might suggest not to "visually indent needlessly" (which I think is a PEP8 rule anyway), but other than that, it probably doesn't matter.

👍

Over time I've developed kind of an allergy to the right aligned variant, but I agree this is not something that needs to be mandated.