Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.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.069 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'subject:Function': 0.09; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals': 0.16; 'globals(),': 0.16; 'globals.': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; 'module,': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'resolution': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'figure': 0.32; 'quite': 0.32; 'subject: (': 0.35; "can't": 0.35; 'except': 0.35; 'received:google.com': 0.35; 'that,': 0.38; 'even': 0.60; 'ian': 0.60; 'simply': 0.61; 'name': 0.63; 'become': 0.64; 'more': 0.64; 'different': 0.65; 'fact,': 0.69; 'difference.': 0.84; 'to:none': 0.92 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=M5ypx+i7XpkRAP6R+52kGGdLU4tPLFDR+3bh68Hs6HQ=; b=nwO0DP9PV2A+W91Rhk4T/leF/VYH/WbzJb9QQYLqEDXWRGuS4Qwlu7ZEFEO29RoMhz rOQM9p6Qafbm7KXNDZQZijmOl0q+y9P8vB8NYPtX8Q5INqMfBvNUiOtiRD1OBt/8Tx3W JaRkEEit1vPRJFKEhf7lagMaVJdJwk3+V+3JkCJHi0uJG08EeEews9w1Yyz4J9XL2J4K IjTXuWVqKoCAAfQYJt6yhGkCovPsP4Tvq+Fm6aNEOB2JUdTlL0dnGgWnhpCh7lcuJXgu M7lSNZcm7o/gbYUkvTJJNLehd8n/uojBujYknc3uUCJfSSHI9dR+5JizRqvgvk5nDPTt UP/g== MIME-Version: 1.0 X-Received: by 10.53.12.229 with SMTP id et5mr17596311vdd.32.1402247597968; Sun, 08 Jun 2014 10:13:17 -0700 (PDT) In-Reply-To: References: <8b96ae27-20fa-4df9-807e-c806fed983c0@googlegroups.com> <1dd863ba-09e5-439b-8669-db65f3e999eb@googlegroups.com> <927afb61-be0e-43a1-8aab-107e77a013fc@googlegroups.com> Date: Mon, 9 Jun 2014 03:13:17 +1000 Subject: Re: Uniform Function Call Syntax (UFCS) From: Chris Angelico Cc: Python 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402247607 news.xs4all.nl 2905 [2001:888:2000:d::a6]:55435 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72979 On Mon, Jun 9, 2014 at 3:08 AM, Ian Kelly wrote: > On Sun, Jun 8, 2014 at 10:48 AM, Chris Angelico wrote: >> Except that it's even more complicated than that, because hasattr >> wasn't defined in your module, so it has a different set of globals. >> In fact, this would mean that hasattr would become quite useless. > > hasattr is a builtin, so it has no globals at all. It would have to > use the calling scope for UFCS resolution as in my example > implementation. Same difference. It can't simply look for the name in globals(), it has to figure out based on the caller's globals. ChrisA