Created
July 3, 2013 09:57
-
-
Save brunobord/5916751 to your computer and use it in GitHub Desktop.
trollish pep8 small rant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
👍
Le deuxième est valide PEP8.
Quand la PEP8 dit "A mais B est aussi acceptable" c'est toujours B la solution lisible.
It depends :P
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agreed™