Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1a.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.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'python,': 0.02; 'syntax': 0.04; 'subject:Python': 0.06; 'matches': 0.07; '3.0,': 0.09; 'default.': 0.09; 'defines': 0.09; 'essential.': 0.09; 'literal': 0.09; 'subject:language': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '3.3,': 0.16; 'backward': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'interactive,': 0.16; 'python3.': 0.16; 'subject: \n ': 0.16; 'use".': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; '(but': 0.19; 'any,': 0.19; 'code,': 0.22; 'previously': 0.22; 'cc:addr:python.org': 0.22; 'unicode': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'relative': 0.30; 'statement': 0.30; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; '(since': 0.31; 'context,': 0.31; 'decimal': 0.31; "we're": 0.32; 'run': 0.32; 'cases': 0.33; 'fri,': 0.33; 'core': 0.34; 'problem.': 0.35; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'complete.': 0.36; 'consistent': 0.36; 'module.': 0.36; "didn't": 0.36; 'useful': 0.36; 'similar': 0.36; 'effort': 0.37; 'performance': 0.37; 'problems': 0.38; '(3)': 0.38; 'same.': 0.38; 'anything': 0.39; 'does': 0.39; 'moving': 0.39; 'enough': 0.39; 'how': 0.40; 'even': 0.60; 'problems.': 0.60; 'solve': 0.60; 'truly': 0.60; 'break': 0.61; 'reserved': 0.61; 'course': 0.61; "you're": 0.61; 'soon': 0.63; 'became': 0.64; 'become': 0.64; 'more': 0.64; 'forward': 0.65; 'believe': 0.68; 'methodology': 0.68; 'default': 0.69; 'fact,': 0.69; 'evaluate': 0.72; 'completion': 0.78; 'glad': 0.83; 'subject:this': 0.83; '"fast"': 0.84; "'using'": 0.84; 'continuum': 0.84; "it'd": 0.84; 'pursuit': 0.84; 'useful!': 0.84; 'why?': 0.91; 'to:none': 0.92; 'wanting': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=JyewBJ9V2guGI32D3JPg13omZztpnIfmMo1EW/b2J4Q=; b=K0SKFdkkS/A5IIqRThrUqUWTFp//ZCm2n7PT0cNin3XP3OHRKCA3voknRhgap+gm9p sK48sgCrTjwV0kRmvDWYXZKmd8oJV8qdBOBMXa5gcT+SwXVanYicFu/VFwmABvzTvdKP B1SnKY7Y81SGnfnIKZW7o59mLZHwhhydirE6TAIJyG1PPcFRxoZqS6+n47knGuqQ2MJV zcLjUSXSdnrtSiFDKuX1v90eeA1Ms0Uj5o3zILGzKNaERxwfIu6WnYKjIWMKxl8nel0c XhkFjM2JTcVYwOBnLRKzblGgsktyhARX6RpujTjTCU4sYsSsaT2gI7SCZBL9FZScKNAY N85g== MIME-Version: 1.0 X-Received: by 10.66.192.225 with SMTP id hj1mr10686355pac.142.1396564996036; Thu, 03 Apr 2014 15:43:16 -0700 (PDT) In-Reply-To: References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <87ior3w740.fsf@elektro.pacujo.net> <5334c38e$0$29994$c3e8da3$5496439d@news.astraweb.com> <53364327$0$29994$c3e8da3$5496439d@news.astraweb.com> <53365F55.2040302@gmail.com> <533836c4$0$29994$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 4 Apr 2014 09:43:15 +1100 Subject: Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396565004 news.xs4all.nl 2870 [2001:888:2000:d::a6]:60978 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69618 On Fri, Apr 4, 2014 at 3:38 AM, Mark H Harris wrote: > 'Useful' must always be taken in context, and also contextually evaluated > with an on-going methodology which constantly informs 'usefulness' on a > continuum. I admire and encourage the core devs, in their pursuit of > excellence. Asking 'what is the practical use case?' is essential. Not > always is the answer complete. > On the python unicode continuum version (3) is more useful than version > (2). ( this is of course relative and debatable, so the statement is > rhetorical ) The commitment and dedicated effort to move forward with a > unicode default is not only commendable, but also admits to the 'usefulness' > of same. Its not that version 2 was useless, its just that version 3 is so > much more useful that people are 'using' it and dedicating their resources > moving forward with python3. > This is similar to the decimal module. Of course it had limited > usefulness in version(2) thru 3.2/ but now, python3.3+ the decimal module > is truly useful! Why? Glad you asked... because it is now fast enough for > use cases previously reserved for floats. I found limited usefulness for > decimal prior to 3.3, but now we're finding decimal so useful that some of > us are wanting decimal to be the default. ( all of this is also relative and > debatable ) So your definition of "useful" for the Decimal module is "fast" and your definition of "useful" for Unicode is "mandated into use". Neither of those is how any dictionary I know defines that word, and you're not even consistent (since you said Unicode became useful at 3.0, which didn't - AFAIK - improve its performance any, while 3.3 did (PEP 393)). Here's one definition: "able to be used for a practical purpose or in several ways". Does not say anything about performance. Python is useful in that I am able to wield it to solve my problems. I don't care that it's slower than C; in fact, a lot of the problems I solve with Python are interactive, and run to completion faster than I can notice them. If I use decimal.Decimal or fractions.Fraction in my code, it is not because it's fast or slow or anything, it is because that type matches what I want to do with it. Those types are useful to me because there are situations in which they match my problem. While I am interested in seeing a Decimal literal syntax in Python, and I would support a shift to have "1.2" evaluate as a Decimal (but not soon - it'd break backward compat *hugely*), I do not by any means believe that Decimal will only become useful when it's the default non-integer type in source code. ChrisA