Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.06; 'only,': 0.07; 'subject:language': 0.09; 'python': 0.11; 'language.': 0.14; 'constructs': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'increment': 0.16; 'inversion': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'namespace,': 0.16; 'only?': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject: \n ': 0.16; 'tool.': 0.16; 'flexibility': 0.16; ':-)': 0.16; 'language': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'header:User-Agent:1': 0.23; 'lets': 0.24; 'prototype': 0.24; '(or': 0.24; 'question': 0.24; 'switch': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'subject:list': 0.30; 'too.': 0.31; 'idea,': 0.31; 'stuff': 0.32; 'another': 0.32; 'problem': 0.35; 'classes': 0.35; 'something': 0.35; 'received:84': 0.35; 'but': 0.35; 'c++': 0.36; 'useful': 0.36; 'should': 0.36; 'easily': 0.37; 'solving': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'ability': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'easy': 0.60; 'new': 0.61; 'simply': 0.61; 'back': 0.62; 'name': 0.63; 'today': 0.64; 'great': 0.65; 'modeling': 0.65; 'therefore': 0.72; 'day': 0.76; 'subject:this': 0.83; 'irrelevant': 0.84; 'iterative': 0.84; 'liking': 0.84; 'technique.': 0.84; 'verb,': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=JLW1sq6b c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=tLkI8qN_j18A:10 a=6SZjXeFKtcYA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=1eI4KEyyn2b7IAKc8WMA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett:2500 Date: Tue, 08 Apr 2014 02:52:37 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <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> <533e811a$0$29993$c3e8da3$5496439d@news.astraweb.com> <874n26su9f.fsf@elektro.pacujo.net> <53418644$0$29993$c3e8da3$5496439d@news.astraweb.com> <38795bc9-f67d-423f-a929-212b6b38ec8c@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396921964 news.xs4all.nl 2860 [2001:888:2000:d::a6]:58730 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69824 On 2014-04-08 02:33, Mark H Harris wrote: > On 4/6/14 12:31 PM, Rustom Mody wrote: > >> I think python wins because it (usually) lets people do their thing >> (includes but not limited to CS-research) >> and gets out of the way. To say therefore that it is irrelevant to the >> research is a strange inversion of its advantages. > > I think so too. I find python useful for modeling (prototyping) > constructs that it [python interpreter] was not 'designed' to do. > >> [Or simply just switch to C++ for 3 months and report back with >> the increment in your white-hair-count] > > Back in the day I used Rexx to prototype a new language idea, or a > new computational technique. Today I use python for prototyping. > > From a CS standpoint I can use python for research in morphology > because of the flexibility and extensibility of the namespace, and the > easy ability to create new nouns and verbs through 'def' (as either > function or generator) and the iterative process over data types like > 'list' and 'dict'. I am playing with neural nets again, using python, > and liking the fact that I can put my ideas into practice easily and > python gets out of the way. I find it a great research language. I am > surprised that others only see it as a problem solving tool. > > > I have another question for y'all, is a function (particularly a > generator) a noun or a verb? Does a function (or generator) 'do' > something (based on name and parms) or does it 'return' something based > on name and parms? Based on name and parms should a function (or > generator) function as a noun, or function as a verb, or *both*? --or, > are Classes nouns only, and all functions *are* verbs only? > A function is an object (noun) that does stuff (verb). Does that make it clearer? :-)