Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'cpython': 0.05; 'differently.': 0.07; 'something,': 0.07; 'python': 0.08; 'object.': 0.09; 'question?': 0.09; 'thoughts?': 0.09; 'tracker': 0.09; 'wrote:': 0.15; 'docs,': 0.16; 'finney': 0.16; 'latter,': 0.16; 'missing?': 0.16; 'stark': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; 'question.': 0.16; 'cc:2**0': 0.21; 'maybe': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'expectation': 0.23; 'referring': 0.23; 'versions': 0.23; 'code': 0.24; 'writes:': 0.25; 'function': 0.26; "i'm": 0.27; 'url:mailman': 0.27; 'seeing': 0.28; 'language.': 0.28; 'objects': 0.28; 'sat,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'compile': 0.29; 'fix': 0.29; 'cc:addr:python.org': 0.30; 'definition': 0.30; 'bugs.': 0.30; 'objects.': 0.30; 'yes.': 0.30; 'subject:?': 0.31; 'url:listinfo': 0.32; "what's": 0.33; 'actually': 0.33; 'there': 0.34; 'clearly': 0.35; 'executable': 0.35; 'subject:What': 0.35; "isn't": 0.35; 'optimization': 0.36; 'url:python': 0.37; 'issue': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'eric': 0.38; 'execution': 0.38; 'think': 0.38; 'two': 0.38; '[1]': 0.39; 'got': 0.39; 'missing': 0.40; 'mark': 0.40; 'received:209': 0.40; 'your': 0.60; 'you.': 0.62; 'super': 0.62; 'facts': 0.64; 'deal,': 0.67; 'received:209.85.215.174': 0.67; 'received:mail- ey0-f174.google.com': 0.67; 'special': 0.67; 'concerns': 0.80; 'yours': 0.84; 'optimisation': 0.84; 'special.': 0.84; 'contrast': 0.91; 'scenario': 0.91; 'snow': 0.91; 'obvious,': 0.93; 'absolutely': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=8mkOa4Tv0ajp+52w4Dl1jo4hwWq0jP/JNCAzlXfHhMs=; b=SZs0oGiUzOKordvrQEV3TyaBwSeNN5RMy9nfrMY4cVE8z8lbSvrRhBE1NfY7A08zHl mR08klJDlH80UhzRXin3aZ9uWo1yILkAsuOX64cLMWiQqnD2ICr+hBkHgh2588eZPZlQ DewC0337nhHYwLOfdBcinrj6EiJWuudSQDHKM= MIME-Version: 1.0 In-Reply-To: <87sjqfgjqg.fsf@benfinney.id.au> References: <87sjqfgjqg.fsf@benfinney.id.au> Date: Sat, 9 Jul 2011 17:16:19 -0600 Subject: Re: What makes functions special? From: Eric Snow To: Ben Finney Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310253381 news.xs4all.nl 21749 [2001:888:2000:d::a6]:51097 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9120 On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wro= te: > Eric Snow writes: > >> A tracker issue [1] recently got me thinking about what makes >> functions special. > > As you describe, functions are special for your scenario because a > function definition needs to result in executable code as an object. > >> Definition time actually happens during compile time, but it has its >> own label to mark the contrast with execution time. So why do >> functions get this special treatment? > > You answer this question. > >> No other objects have code objects. No other objects in Python have >> this special optimization. > > Yes. The two facts are directly related. > >> Maybe I am missing something, or maybe it is super obvious, but isn't >> this a critical point? > > What is the crisis (=93a stark change from one state to another=94) that > you're referring to by =93a critical point=94? > > Yes, functions are different and are treated differently. What's your > question? > >> From the docs, the code objects in of function objects are the latter, >> but the optimization expectation is not clearly indicated. Are there >> other motivations behind code objects that I am missing? Am I wrong >> about the optimization expectation? > > What optimisation expectation? > >> Thoughts? > > I think yours need to be expressed more explicitly; I'm not seeing the > issue that concerns you. > My point is that functions are special in Python because they provide a built in optimization via the special execution of code objects. I would like to know if it is really that big a deal, and if the optimized execution of code objects is a CPython implementation detail or a specification of the language. -eric > -- > =A0\ =A0 =A0 =A0 =A0=93The reason we come up with new versions is not to = fix bugs. | > =A0`\ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 It's absolutely not.=94 =97= Bill Gates, 1995-10-23 | > _o__) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| > Ben Finney > -- > http://mail.python.org/mailman/listinfo/python-list >