variable access question

oliver fwang2 at yahoo.com
Wed May 10 12:18:18 EDT 2000


thanks for reply, and yes, I meant to have mulitple instance of class B,
and they all want to acceess one instance of Class A's "queue" variable,
the code follows doesn't seem to be able to do it. I am a bit confused
here. could you clarify it on that?

> 
> This is the answer to your question:
> 
>     class A:
>         queue = Queue(10)
> 
>     class B:
>         queue = A.queue
> 
> Are you sure you don't want to use instances and not classes?





More information about the Python-list mailing list