Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:edu.au': 0.07; 'argument,': 0.09; 'readable': 0.09; 'volunteer': 0.10; ';-)': 0.12; 'argument': 0.15; 'alex23': 0.16; 'code?': 0.16; 'constructs': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'sequence.': 0.16; 'subject:syntax': 0.16; 'cc:addr:python-list': 0.16; 'syntax': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.20; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'optional': 0.23; 'cc:2**0': 0.24; 'there.': 0.24; 'specify': 0.24; 'code': 0.25; "i'm": 0.26; 'function': 0.27; 'cc:addr:python.org': 0.29; 'lines': 0.30; 'topic': 0.30; 'does': 0.32; 'list': 0.32; 'header :User-Agent:1': 0.33; '"we': 0.34; 'list.': 0.35; 'received:au': 0.36; 'skip:" 10': 0.37; 'two': 0.37; 'but': 0.37; 'getting': 0.38; 'should': 0.39; 'else': 0.39; 'more': 0.61; 'type': 0.61; 'your': 0.61; 'everybody': 0.63; 'cost': 0.63; 'our': 0.64; 'view': 0.65; 'alternative': 0.65; 'received:202': 0.66; 'what,': 0.67; 'cameron': 0.73; 'motorcycle': 0.91 Date: Wed, 14 Dec 2011 06:11:27 +1100 From: Cameron Simpson To: Eelco Subject: Re: Verbose and flexible args and kwargs syntax MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323803498 news.xs4all.nl 6868 [2001:888:2000:d::a6]:56213 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17162 On 13Dec2011 00:30, Eelco wrote: | On Dec 13, 1:27 am, alex23 wrote: | > On Dec 13, 3:12 am, Eelco wrote: | > > But to relate it to the topic of this thread: no, the syntax does not | > > allow one to select the type of the resulting sequence. It always | > > constructs a list. | > | > So by this argument, _every_ function that returns a list should take | > an optional argument to specify an alternative form of sequence. | > | > What, exactly, is so onerous about coercing your list to _whatever_ | > type you want? You know, like everybody else has been. | > | > What does this _gain_ you other than one less line of code? | | 1) Turning two lines of code into a single more readable one is | nothing to scoff at | 2) After-the-fact conversion is O(n), getting the view you want right | away is O(1) Regarding (2), it has already cost you O(n) to get there. So your O(1) is a little ingenuous. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ I'm a volunteer EMT-I on our local ambulance service; one of our Paramedics calls squid style motorcycle accidents "ZoomSplats", as in "we had a good ZoomSplat the other night". ;-) - Scott