Classes in a class: how to access variables from one in another

Chris Rebert clp2 at rebertia.com
Tue Oct 19 00:22:42 EDT 2010


On Mon, Oct 18, 2010 at 3:24 PM, Steven D'Aprano
<steve at remove-this-cybersource.com.au> wrote:
> On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
>
>> Also, Python's scoping rules, particularly for class-level scopes, don't
>> work the way programmers from languages where nested classes are common
>> would expect:
> [snip example]
>
> I'm sorry, I don't see that "language Foo programmers will be surprised
> that Python is not language Foo" is an argument against Python
> programmers using nested classes. Surely it's an argument against writing
> Foo in Python?

Touché; however, Python's semantics here differ so drastically from
most other languages and the construction in question is so rarely
used or useful that anyone who does use it is likely either in the
running for Python language-lawyers-of-the-year or has a vendetta
against polyglot programmers. :-)

Cheers,
Chris
--
Why am I reminded of for-else...
Also, where does one get a Juris Doctor Programmatica?
http://blog.rebertia.com



More information about the Python-list mailing list