The Zen of Python distils the guiding principles for Python into 20 aphorisms but lists only 19. What's the twentieth?
From PEP 20, The Zen of Python:
Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.
What is this twentieth aphorism? Does it exist, or is the reference merely a rhetor开发者_JAVA百科ical device to make the reader think?
(One potential answer that occurs to me is that "You aren't going to need it" is the remaining aphorism. If that were the case, it would both exist and act to make the reader think, and it would be characteristically playful, thus fitting the list all the better. But web searches suggest this to be an extreme programming mantra, not intrinsically Pythonic wisdom, so I'm stumped.)
I had the opportunity to ask Guido about this recently. According to him, this is "some bizarre Tim Peters in-joke". That, and/or (still according to him) it's an opportunity for people to provide their own addition (as largely is happening in the answers to this question :-) ).
It has to be SIGNIFICANT WHITESPACE, of course!
The number of this PEP was intentionally chosen - as PEP index doesn't have to be continuous -leaving Tim with the freedom to choose whatever number he wanted.
Now the question comes to why the number 20
was chosen, if 19 aphorisms were written, why he didn't name his proposal as PEP19? - This is where Zen started to be involved.
In the Zen-fluenced Japanese sushi restaurants, customers have the option to choose Omakase which means "I'll leave it up to you", in return (not typical but sometimes) the sushi chef will ask the customers to choose the last piece of sushi - either exploring a new fish or aftertast-ing a previous one - conceptual-wise it correlates to what @Jeff Walden mentioned in his answer where people have the opportunity to provide their own addition to complete the set.
After all it's all pure speculation.
Rule number 20: there is no rule #20.
This replaced the old rule #20: "you do not talk about fight club".
I suggest that it is PEP 20. Very zen.
20: "You must discover this for yourself, grasshopper."
20: "There are only 19"
*waves hand*
(jedi mind trick)
Tim Peters mentions that he left the 20th Aphorism for Guido to fill in, in an email exchange (link posted by Guido van Rossum on twitter).
"There you go: 20 Pythonic Fec^H^H^HTheses on the nose, counting the one I'm leaving for Guido to fill in" - Tim Peters
Source: Python mail link Tweet link
The 20th principle is a matter of opinion, but my interpretation is that the blank line (right after "The Zen of Python, by Tim Peters") means "Use whitespace".
20: "Don't forget to drink your Ovaltine"
PEP 20 : is missing intentionally : which could imply: "keep yourself updated, keep searching for something new" "make your own pep 20"
In the documentation, the "import this" command is listed as Easter Egg, so it was not written by Tim Peters but it is included in the PEP20 and it adds something not listed in the previous 19 aphorisms, so it must be the case for it to be the 20th. Looking more closely, it is an underlying message for pythonists to have PEP20 in mind when programming with python: "import this ideas".
For those needing clarification of what this is about, here is a helpful resource that I found that adds to "The Zen of Python" discussion (Zen of Python).
Additionally, here is a quote from wikipedia:
Peters's Zen of Python was included as entry number 20 in the language's official Python Enhancement Proposals and was released into the public domain.[3] It is also included as an Easter egg in the Python interpreter, where it can be displayed by entering import this.[1][3]
精彩评论