Python for beginners or not? [was Re: syntax difference]
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Mon Jun 25 06:53:26 EDT 2018
On Sun, 24 Jun 2018 10:46:09 -0700, Jim Lee wrote:
> On 06/24/2018 04:35 AM, Steven D'Aprano wrote:
>>
>> Indeed. That's one of the beauties of Python -- even when there's an
>> advanced way to do it, there's generally a simple way too.
>>
>>
> What happened to the Python maxim "There should be one—and preferably
> only one—obvious way to do it"?
What about it?
"There should be (at least) one (OBVIOUS WAY) to do it" does not preclude
there being a million other non-obvious ways to do it. Even if we prefer
only one (OBVIOUS WAY).
Besides, its the Zen of Python. We should all know about Zen:
In the second scroll of Wen the Eternally Surprised a story
is written concerning one day when the apprentice Clodpool,
in a rebellious mood, approached Wen and spake thusly:
"Master, what is the difference between a humanistic, monastic
system of belief in which wisdom is sought by means of an
apparently nonsensical system of questions and answers, and a
lot of mystic gibberish made up on the spur of the moment?"
Wen considered this for some time, and at last said: "A fish!"
And Clodpool went away, satisfied.
-- (Terry Pratchett, "Thief of Time")
Nearly everybody misses the fact that the Zen is a joke, not to be taken
*too* seriously. A particularly subtle joke, but still a joke.
https://www.wefearchange.org/2010/06/import-this-and-zen-of-python.html
And the specific line you reference is *especially* a joke, one which
flies past nearly everyone's head:
There should be one-- and preferably only one --obvious way to do it.
Notice the dashes? There are *two* traditional ways to use an pair of em-
dashes for parenthetical asides:
1. With no space--like this--between the parenthetical aside and the text;
2. With a single space on either side -- like this -- between the aside
and the rest of the text.
Not satisfied with those two ways, Tim invented his own.
https://bugs.python.org/issue3364
(Good grief, its been nearly ten years since that bug report. I remember
it like it was yesterday.)
--
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson
More information about the Python-list
mailing list