Created
January 14, 2013 01:21
-
-
Save temoto/4527143 to your computer and use it in GitHub Desktop.
Python pep8, long lines wrap rules, indentation
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
def inside(): | |
# Good. Consistent. You know up front where to put continuation. | |
# Also consistently short, no matter how long is `xs = itertools.ifilter`. | |
xs = itertools.ifilter(fun, [very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name4]) | |
# Bad. Lots of space wasted. Rename 'xs' and you have to reindent everything. | |
xs = itertools.ifilter(fun, | |
[very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name_4]) | |
class A: | |
items = ( | |
'how', | |
'about', | |
'this', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I prefer using this type of indentation.