Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Parens do create a tuple Date: Mon, 11 Apr 2016 11:41:52 +1000 Lines: 31 Message-ID: References: <1460333911.3449208.574628345.4B46CD32@webmail.messagingengine.com> <85r3ed2ctn.fsf_-_@benfinney.id.au> <85inzp2c93.fsf@benfinney.id.au> <857fg43orj.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de S7ymkDAvfvvhe1E3VseoRQuku/HeKIm7K8P7ou8QXrAQ== Cancel-Lock: sha1:BWl85mHb502Z0n7txF8zg1u1oNo= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'subject:create': 0.09; 'tuple.': 0.09; 'python': 0.10; 'python.': 0.11; '*only*': 0.16; 'comma.': 0.16; 'enough.': 0.16; 'one-element': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'singleton': 0.16; 'trap': 0.16; 'trap.': 0.16; 'say,': 0.18; 'creates': 0.18; 'tuples': 0.22; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'chris': 0.26; 'point.': 0.27; 'correct': 0.28; 'idea': 0.28; 'fine': 0.28; "i'd": 0.31; 'statement': 0.32; 'true.': 0.33; 'except': 0.34; 'false': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'created': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:org': 0.37; 'wrong': 0.38; 'does': 0.39; 'enough': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'skip:u 10': 0.61; 'avoid': 0.61; 'great': 0.63; '_o__)': 0.84; 'received:125': 0.84; 'score.': 0.84 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.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <857fg43orj.fsf@benfinney.id.au> X-Mailman-Original-References: <1460333911.3449208.574628345.4B46CD32@webmail.messagingengine.com> <85r3ed2ctn.fsf_-_@benfinney.id.au> <85inzp2c93.fsf@benfinney.id.au> Xref: csiph.com comp.lang.python:106830 Chris Angelico writes: > Fair enough. Let's instead say "commas create tuples", which is true > in all cases except the singleton empty tuple. Is that near enough > that we can avoid the detail? It's a fine thing to say, because it's simply true. Commas create tuples. There are some tuples that cannot be created as a literal by comma. That does not make the statement untrue. They are not the *only* thing that creates tuples; parens can also create tuples. So we should avoid false statements on that score. > I'd rather be correct on the one-element case and wrong on the empty > than the other way around. To say “commas create tuples” is to say an unobjectionably true statement about Python syntax. It remains true as one continues to learn Python. To say “parens do not create tuples” is to lay a trap which needs to be de-fused at some point. Better IMO never to lay that trap. -- \ “It’s a great idea to come in unencumbered by dogma but you | `\ can’t also be unencumbered by evidence.” —Darren Saunders, | _o__) 2015-12-02 | Ben Finney