What does this sentence mean in 'The Zen of Python'?
Please tell me what the follow开发者_如何学编程ing sentence means in 'The Zen of Python'.
"Although that way may not be obvious at first unless you’re Dutch."
Thanks in advance.
It is a reference to the fact that Python's creator, Guido van Rossum, is Dutch.
When Python was not so popular, and mostly used by scripters and IT people to avoid bash monsters, features and modules and stuff went into the language without pondering over them as much as today.
A simple example: the backtick
operator was syntactic sugar for repr().
The "one obvious way to do it" was opposed to the "many ways to do it" of Perl, and the backtick is a perlism that Python has since lost.
Apart from a few small things like that, Guido has always strived to keep the language consistent, balancing between pragmatism and minimalism. It took several years of discussions in comp.lang.python before adding a ternary operator.
The sentence you quote is Tim Peter's way to suggest that people should not lobby for their favourite features, borrowing them from other languages, when Python already has its way to accomplish the same results.
zen : a state of calm attentiveness in which one's actions are guided by intuition rather than by conscious effort. It might have been the intuition of Time Peters that urges programmers to essentially use their Zen . My experience with Python was it was far far better than any other language and essentially all the unnecessary sytanx used before a print statement were obliterated with this language . Print(1+2) >>> 3 its that simple..
精彩评论