4 ms·
A "how this differs from PEP8" summary would be useful to me, assuming it differs.
by tvon 17y ago
A "how this differs from PEP8" summary would be useful to me, assuming it differs.
- d0mine 17y agoThe crucial difference: Google (original formatting): BE CONSISTENT. PEP8: A Foolish Consistency is the Hobgoblin of Little Minds
- sigzero 17y agoNo...those are different. One is just telling you to "be" consistent and the other is telling you not to be "foolish" about it. Much different in my mind.
- vcrash 17y agoSeeing as the response is to a comment asking for differences, wouldn't it make sense to assume that it shows differences? In fact, the response notes that they are an example of a "crucial difference".
- tvon 17y agoI think sigzero means "different" as in "not contradictory or in conflict"
- d0mine 16y agoGoogle uses CAPS LOCK that I understand as a command "be consistent no matter what". The quote from PEP8 translates in my mind to "be consistent if it's worth it". These policies are not orthogonal. You can't satisfy both in all cases.
- etal 17y agoI had thought the main difference was indenting with 2 spaces instead of 4, but this style guide says 4 spaces, too. I guess Google deliberately brought themselves in sync with the Python mainstream. This style guide looks like a superset of PEP 8 -- where PEP 8 describes what Python code should look like, this guide goes through every Python feature and lays out exactly where a sizable group of top-notch Python hackers were willing to draw the line on maintainability vs. whipupitude for large, long-running projects.
- durin42 17y agoThis is decidedly not the same as the internal guide. 2-space indents are the norm, and functions_like_this are supposed to be spelled FunctionsLikeThis (yes, with the leading capital). Those are the two big differences from PEP8 that I can think of.