Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'resulting': 0.04; 'attribute': 0.07; 'method.': 0.07; 'imply': 0.09; 'parsed': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.12; 'dotted': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'type)': 0.16; 'wrote:': 0.18; '(not': 0.18; 'separate': 0.22; 'header:User- Agent:1': 0.23; '(or': 0.24; 'this:': 0.26; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'yes.': 0.31; 'class': 0.32; 'something': 0.35; 'method': 0.36; 'depends': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'expression': 0.60; 'name': 0.63; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Building CPython Date: Fri, 15 May 2015 19:54:31 -0400 References: <7JN4x.37133$Q41.15375@fx25.am4> <6w35x.645690$I97.19867@fx31.am4> <874mnfunpn.fsf@elektro.pacujo.net> <87bnhmgqrx.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431734090 news.xs4all.nl 2836 [2001:888:2000:d::a6]:38464 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90698 On 5/15/2015 5:54 PM, BartC wrote: > What /is/ a method lookup? Is it when you have this: > > A.B() This is parsed as (A.B)() > and need to find whether the expression A (or its class or type) has a > name B associated with it? Yes. Dotted names imply an attribute lookup. > (And it then needs to check whether B is something that can be called.) The object resulting from the attribute lookup, A.B (not B exactly), is called in a separate operation (with a separate bytecode). It depends on the object having a .__call__ method. The .__call__ method is *executed* (rather than *called*, which would lead to infinite regress). -- Terry Jan Reedy