On Tue, Jan 21, 2014 at 9:20 PM, Robert Voigtländer <r.voigtlaen...@gmail.com> wrote: > def calcRoute(self): > self.openlist.append(Node(self.start, None, 0, 0)) > for Node in self.openlist: print Node.pos, Node.parent, Node.g, > Node.h, Node.f
You're using the name Node to mean two different things. In the first line, you expect it to be the global name (which is the class), but on the second, you want to iterate over the node instances. That assigns to the name Node, which causes your problems. I recommend using a different name for the instances here, probably with a lower-case first letter. That would solve your problem _and_ make your code more readable. ChrisA -- https://mail.python.org/mailman/listinfo/python-list