Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83664

Re: Namespace puzzle, list comprehension fails within class definition

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'lookup': 0.09; 'message-id:@stoneleaf.us': 0.09; 'subject:skip:c 10': 0.09; '~ethan~': 0.09; 'jan': 0.12; 'ah,': 0.16; 'filename:fname piece:signature': 0.16; 'scope.': 0.16; 'skips': 0.16; 'subject:class': 0.16; 'subject:fails': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'header:In-Reply- To:1': 0.27; 'subject:list': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'class': 0.32; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:173': 0.61; 'name': 0.63; '2015': 0.84; 'actually,': 0.84; 'ethan': 0.84; 'furman': 0.84
Date Mon, 12 Jan 2015 22:00:27 -0800
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Namespace puzzle, list comprehension fails within class definition
References <af9bb2fd-f0b9-4efb-874e-78f30ac65b7e@googlegroups.com> <mailman.17638.1421095249.18130.python-list@python.org> <54b4a3dd$0$2738$c3e8da3$76491128@news.astraweb.com>
In-Reply-To <54b4a3dd$0$2738$c3e8da3$76491128@news.astraweb.com>
Content-Type multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="woEv2iXvsOKLi0pGbnmAENQ18SgWFaKNf"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17657.1421128832.18130.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421128832 news.xs4all.nl 2935 [2001:888:2000:d::a6]:55663
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83664

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 01/12/2015 08:49 PM, Steven D'Aprano wrote:
> On Mon, 12 Jan 2015 12:40:13 -0800, Ethan Furman wrote:
>> 
>> [...] class name lookup skips nonlocal namespaces.
> 
> Actually, no it doesn't.
> [...] 
> The "problem" is that *functions* lookup don't include the class body in 
> their scope.

Ah, thanks for the correction!

--
~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Namespace puzzle, list comprehension fails within class definition John Ladasky <john_ladasky@sbcglobal.net> - 2015-01-12 12:25 -0800
  Re: Namespace puzzle, list comprehension fails within class definition Ethan Furman <ethan@stoneleaf.us> - 2015-01-12 12:40 -0800
    Re: Namespace puzzle, list comprehension fails within class definition John Ladasky <john_ladasky@sbcglobal.net> - 2015-01-12 12:49 -0800
    Re: Namespace puzzle, list comprehension fails within class definition Steven D'Aprano <steve@pearwood.info> - 2015-01-13 04:49 +0000
      Re: Namespace puzzle, list comprehension fails within class definition Ethan Furman <ethan@stoneleaf.us> - 2015-01-12 22:00 -0800
  Re: Namespace puzzle, list comprehension fails within class definition John Ladasky <john_ladasky@sbcglobal.net> - 2015-01-12 12:43 -0800
  Re: Namespace puzzle, list comprehension fails within class definition Chris Angelico <rosuav@gmail.com> - 2015-01-13 07:51 +1100

csiph-web