Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Is vars() the most useless Python built-in ever? Date: Wed, 02 Dec 2015 12:47:40 +1100 Lines: 33 Message-ID: References: <565cf141$0$1612$c3e8da3$5496439d@news.astraweb.com> <4f0f7fc5-c93a-4223-9c05-e192a8fafbbd@googlegroups.com> <565d5282$0$14486$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de WcvDhJTyBOkFCkj239JBCgnb80Oc75Qz/HXLuwMBM/ng== Cancel-Lock: sha1:3YxVYN8e71+w5BafU+dQQzfLK74= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'preferably': 0.05; 'modifier': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '(but': 0.15; 'multitude': 0.16; 'omitting': 0.16; 'one)': 0.16; 'pythonic': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:ever': 0.16; 'subject:most': 0.16; 'exists': 0.18; 'say,': 0.18; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; '(although': 0.29; 'wright': 0.29; 'certainly': 0.30; 'another': 0.32; 'options': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'text': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'does': 0.39; 'subject:the': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'care': 0.60; 'skip:u 10': 0.61; 'more': 0.63; 'further,': 0.72; 'obvious': 0.76; '(yet)': 0.84; '_o__)': 0.84; 'it"': 0.84; 'received:125': 0.84; 'choice.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99842 Steven D'Aprano writes: > You misunderstand the koan. > > "There should be one way to do it" does not prohibit more than one > way. Further, that's omitting a very important modifier from the koan. Even without the parenthetical, the koan reads: There should be one obvious way to do it. So yes, there can certainly be multiple ways to do it. But it's very important that there be one *obvious* way. In other words: Don't present the user with a multitude of options with no *obvious* choice for those who don't care (yet) to learn about the choice. Make one of them *obvious* so that's the usually-correct choice. > (Although having multiple redundant ways is discouraged.) The koan > exists to encourage the existence of *at least* one (but preferably > only one) way to do it. And the Pythonic approach is to make an *obvious* way to do it. As you say, ‘print’ is that one obvious way for emitting simple text output. -- \ “What's another word for Thesaurus?” —Steven Wright | `\ | _o__) | Ben Finney