python question about classes

diffuser78 at gmail.com diffuser78 at gmail.com
Tue Mar 14 03:21:56 CET 2006


I have following two classes
Code:

## file_A.py
class A(object):
    ## a contains is instances of A
    a= [ ] def __init__(self, node):
    self.nodes_in_A = []
    self.nodes_in_A.append(node) packet_queue = [ ] ...etc

## file_B.py
import A
class B(object):
    ## n contains instances of B
    n = [ ] def some_func(self):
    _len = len (A.A.a[0].packet_queue)


I get an error AttributeError: 'A' object has no attribute
'packet_queue'


Can you please explain me ...why ? and How to fix this ?




More information about the Python-list mailing list