Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!lightspeed!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed3.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.091 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; 'subject:Function': 0.09; 'globals': 0.16; 'globals.': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'example': 0.22; 'module,': 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; 'quite': 0.32; 'subject: (': 0.35; 'except': 0.35; 'received:google.com': 0.35; 'to:addr :python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'become': 0.64; 'more': 0.64; 'different': 0.65; 'fact,': 0.69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=/xHeUFT9rsun7dJ84P480MOwT2RohEeTFEJwPQnC7cU=; b=vs7JsN1fx6UycF78WYNwNHwmIV6DNEPgm/616nibaveLXyJR/YaFRMpIYjVIfxSCX3 xuW1mUnNA+6oxthQNNXbKs763kkclc7ShJMxP6MJUuVmygK8umzLuvtgyVom9MAj2pe9 Epln5sgrV++bmagYQ0m2r+xLKpK0fUVjc0eyPqeoXf8PrK4bcvDufBQJMVIjx3XzYmRi ILzz9sdV7fG0GKlCEhL+UlP67Ad2T5AZ8Q4PrD5vpQ6Mx85z68HmgaGjcZNi7WZUJ/WC kfhcVqiYajlUb2M1pnTIdzF+AmZfeQ81aKXO/tK7TZPe9KSteqEQHlQVWe6Op0+VuWg1 A1qw== X-Received: by 10.236.88.193 with SMTP id a41mr8558938yhf.22.1402247371145; Sun, 08 Jun 2014 10:09:31 -0700 (PDT) MIME-Version: 1.0 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> From: Ian Kelly Date: Sun, 8 Jun 2014 11:08:50 -0600 Subject: Re: Uniform Function Call Syntax (UFCS) To: 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: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402247374 news.xs4all.nl 2927 [2001:888:2000:d::a6]:49389 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3598 X-Received-Body-CRC: 2762004246 Xref: csiph.com comp.lang.python:72977 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.