Neil Cerutti <ne...@norwich.edu> wrote:
>> I have a class A that contains two classes B and C:
>>
>> class A:
>>   class B:
>>     self.x = 2
>>   
>>   class C:

I only wanted to show the structure of the code, not the actual
instructions.

> That's not valid Python code. Do you mean:
> 
> Class A:
>  Class B:
>    x = 2

> Class A:
>  Class B:
>    def __init__(self):
>      self.x = 2
> 

Any of these, aslong as I can access x  in C.

By the way, is the first proposition (that is, x = 2, without the
self.) valid? Is x a global variable then?

Thanks.

-- 
F. Delente
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to