Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe17.ams2.POSTED!00000000!not-for-mail Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Newsgroups: comp.lang.python Subject: Re: Namespaces in functions vs classes References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Rhodri James" Message-ID: User-Agent: Opera Mail/11.10 (Linux) Lines: 34 NNTP-Posting-Host: 82.8.62.87 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe17.ams2 1303250453 82.8.62.87 (Tue, 19 Apr 2011 22:00:53 UTC) NNTP-Posting-Date: Tue, 19 Apr 2011 22:00:53 UTC Organization: virginmedia.com Date: Tue, 19 Apr 2011 23:00:45 +0100 Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3595 On Tue, 19 Apr 2011 17:47:40 +0100, Gerald Britton wrote: >> Gerald Britton wrote: >>> I now understand the Python does >>> not consider a class definition as a separate namespace as it does for >>> function definitions. That is a helpful understanding. > >> That is not correct. Classes are separate namespaces -- they just >> aren't automatically searched. The only namespaces that are >> automatically searched are local, non-local, global, and built-in. > > I see you misunderstood my observation: Python does not consider a class > definition as a separate namespace *as it does* for function definitions. This phrase normally parses as "Python does not consider a class definition as a separate namespace. In contrast, Python does consider a function definition as a separate namespace." If you meant "Python does not consider a class definition as a separate namespace *in the same way* that it does for function definitions," saying so would make life easier for the fairly large number of readers of this newsgroup whose first language isn't English. Language abuse: it's not just Python. A donation of just $5 will keep a programmer in prepositions for a month. $50 will supply enough articles to keep a small company understandable for over a year. With your generous help, we can beat this scourge! Ahem. Normal service will now be resumed. -- Rhodri James *-* Wildebeest Herder to the Masses