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

Date 2015-01-12 22:00 -0800
From Ethan Furman <ethan@stoneleaf.us>
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>
Newsgroups comp.lang.python
Message-ID <mailman.17657.1421128832.18130.python-list@python.org> (permalink)

Show all headers | 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