Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'mrab': 0.05; 'python': 0.09; 'declarations': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.10; ':-)': 0.13; '"global"': 0.16; 'declaration': 0.16; 'definition.': 0.16; "function's": 0.16; 'lambda': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Objects': 0.16; 'wrote:': 0.17; 'exists': 0.17; 'versions': 0.20; 'assuming': 0.22; 'latter': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'python).': 0.29; "i'm": 0.29; 'function': 0.30; '(and': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'function.': 0.33; 'to:addr:python- list': 0.33; 'self': 0.34; 'received:org': 0.36; 'but': 0.36; 'compare': 0.36; 'method': 0.36; 'far': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'from:': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'kat': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Objects in Python Date: Wed, 22 Aug 2012 21:46:29 +0100 References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> <503541B7.2050908@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-123-14.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <503541B7.2050908@mrabarnett.plus.com> X-Antivirus: avast! (VPS 120821-0, 21/08/2012), Outbound message X-Antivirus-Status: Clean 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345668352 news.xs4all.nl 6884 [2001:888:2000:d::a6]:51233 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27684 On 22/08/2012 21:31, MRAB wrote: > On 22/08/2012 20:45, lipska the kat wrote: >> >> compare this to a function declaration in Python >> >> def foo(self): >> > [snip] > That's not actually a declaration but a definition. :-) > > The function's body is bound to the name at runtime, so: > > def double_it(x): > return x * 2 > > is not far from: > > double_it = lambda x: x * 2 > > The only declarations are "global" and "nonlocal" (and the latter > exists only in recent versions of Python). Looking at the self I'm assuming that's a method and not a function. -- Cheers. Mark Lawrence.