Skip to content

Instantly share code, notes, and snippets.

@brunobord
Created July 3, 2013 09:57
Show Gist options
  • Save brunobord/5916751 to your computer and use it in GitHub Desktop.
Save brunobord/5916751 to your computer and use it in GitHub Desktop.
trollish pep8 small rant
# If I had one PEP8 rule to wipe off, that would be the "argument indentation" thing
# isn't this PEP8-compliant code a bit against the "Flat is better than Nested" zen of Python?
my_superb_variable = MyBloodyClass(arg1='here is an argument',
label=_(u'What a beautiful label'),
argument2='sorry',
argument3=False)
# And in this case, I'm lucky. I'm not *inside* a class method or worse: inside a loop or a condition inside a class method.
# I really hate this indentation.
# I prefer:
my_superb_variable = MyBloodyClass(
arg1='here is an argument',
label=_(u'What a beautiful label'),
argument2='sorry',
argument3=False
)
# ... It's... flatter, *and* indented the way if/loop blocks are.
@n1k0
Copy link

n1k0 commented Jul 3, 2013

Agreed™

@wo0dyn
Copy link

wo0dyn commented Jul 3, 2013

👍

@aaugustin
Copy link

Le deuxième est valide PEP8.

Quand la PEP8 dit "A mais B est aussi acceptable" c'est toujours B la solution lisible.

@Natim
Copy link

Natim commented Jul 4, 2013

It depends :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment