Skip to content

Commit 8b25109

Browse files
author
Kenneth Reitz
committed
Merge pull request realpython#51 from john2x/master
Added full "Zen of Python" to Code Style section.
2 parents 19111aa + 32f664a commit 8b25109

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/writing/style.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ Also known as PEP 20, the guiding principles for Python's design.
1616
::
1717

1818
>>> import this
19+
The Zen of Python, by Tim Peters
20+
21+
Beautiful is better than ugly.
22+
Explicit is better than implicit.
23+
Simple is better than complex.
24+
Complex is better than complicated.
25+
Flat is better than nested.
26+
Sparse is better than dense.
27+
Readability counts.
28+
Special cases aren't special enough to break the rules.
29+
Although practicality beats purity.
30+
Errors should never pass silently.
31+
Unless explicitly silenced.
32+
In the face of ambiguity, refuse the temptation to guess.
33+
There should be one-- and preferably only one --obvious way to do it.
34+
Although that way may not be obvious at first unless you're Dutch.
35+
Now is better than never.
36+
Although never is often better than *right* now.
37+
If the implementation is hard to explain, it's a bad idea.
38+
If the implementation is easy to explain, it may be a good idea.
39+
Namespaces are one honking great idea -- let's do more of those!
1940

2041
See `<http://stackoverflow.com/questions/228181/the-zen-of-python>`_ for some
2142
examples.

0 commit comments

Comments
 (0)