Created
November 7, 2012 00:23
-
-
Save wesrog/4028654 to your computer and use it in GitHub Desktop.
python indentation
This file contains hidden or 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
# aligned | |
return str('%s://%s/%s%s' % ( | |
self.url_scheme, | |
self.get_host(domain_part), | |
posixpath.join(self.script_name[:-1].lstrip('/'), | |
url_quote(path_info.lstrip('/'), self.map.charset, | |
safe='/:|+')), | |
suffix | |
)) | |
# hanging | |
return str('%s://%s/%s%s' % ( | |
self.url_scheme, | |
self.get_host(domain_part), | |
posixpath.join(self.script_name[:-1].lstrip('/'), | |
url_quote(path_info.lstrip('/'), self.map.charset, | |
safe='/:|+')), | |
suffix | |
)) | |
# aligned (again) | |
return str('%s://%s/%s%s' % ( | |
self.url_scheme, | |
self.get_host(domain_part), | |
posixpath.join( | |
self.script_name[:-1].lstrip('/'), | |
url_quote( | |
path_info.lstrip('/'), | |
self.map.charset, | |
safe='/:|+' | |
) | |
), | |
suffix | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 I like how you would have done it. I agree with the 'soft' closing parens also and would change mine to do the same.