class Network():
tables = []
def readInFile():
network = Network()
def printThing(network):
print(len(network.tables))
def main():
network = readInFile()
printThing(network)
if __name__ == "__main__":
main()
gives error: File "thing.py", line 6, in printThing print(len(network.tables)) AttributeError: 'NoneType' object has no attribute 'tables'
But the object network isn't NoneType it's clearly of type Network() when it is instantiated in the readInFile function, and type Network() has the attribute tables! Please help, thanks