TypeError: unbound method add() must be called with BinaryTree instance as first argument (got nothing instead)

2013-05-18 Thread Dan Stromberg
I'm getting the error in the subject, from the following code: def add(self, key): Adds a node containing I{key} to the subtree rooted at I{self}, returning the added node. node = self.find(key) if not node: node.key = key

Re: TypeError: unbound method add() must be called with BinaryTree instance as first argument (got nothing instead)

2013-05-18 Thread Peter Otten
Dan Stromberg wrote: I'm getting the error in the subject, from the following code: def add(self, key): Adds a node containing I{key} to the subtree rooted at I{self}, returning the added node. node = self.find(key) if not node:

Re: TypeError: unbound method add() must be called with BinaryTree instance as first argument (got nothing instead)

2013-05-18 Thread Peter Otten
Dan Stromberg wrote: python 2.x, python 3.x and pypy all give this same error, though jython errors out at a different point in the same method. By the way, 3.x doesn't have unbound methods, so that should work. -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: unbound method add() must be called with BinaryTree instance as first argument (got nothing instead)

2013-05-18 Thread Terry Jan Reedy
On 5/18/2013 3:46 PM, Peter Otten wrote: Dan Stromberg wrote: python 2.x, python 3.x and pypy all give this same error, though jython errors out at a different point in the same method. By the way, 3.x doesn't have unbound methods, so that should work. It does for this example (3.3.1) c =