Why nested scope rules do not apply to inner Class?

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Thu Aug 14 03:11:12 EDT 2008


Calvin Spealman a écrit :
> On Wed, Aug 13, 2008 at 11:32 AM, Cousson, Benoit <b-cousson at ti.com> wrote:

(snip)
> There is no point of nested classes because nested classes _are not_
> supported by python.

Depending on the definition of "supported".

(snip)

>> In my case, I'm trying to use a similar approach as XIST's one,
>> meaning using Python class to model hierarchical data. So clearly nested
 >> class is a very nice and easy understandable way to do that.
>
> I don't find that this is clear in anyway. I can't imagine why you'd
> think a nested class is even useful here, rather than an instance with
> some understandable attributes.

I onced played with the same idea, ie using nested classes as a 
declarative approach to XML/HTML generation. It didn't quite work - at 
least not well enough to be worth spending more time on the topic - but 
at least I can imagine why the OP thinks "true" nested classes would 
have help here.




More information about the Python-list mailing list