Derived class doesn't recognise arguments of method from parent
Question: I'm trying to make a set of functions to operate easily through some data. The
problem I'm facing is: it seems to recognize and use methods from the parent
class, except one: `show()`, giving me errors about **unexpected arguments**.

Here's a sample of the classes:

    
    
    from treelib import Tree, Node
    
    class Join(Tree):
    
        def __init__(self, id, desc, childs=(), *args, **kwargs):
    
            Tree.__init__(self, *args, **kwargs)
    
            self.id = id
            self.desc = desc
            self.value = None
            self.parent = None
            self.childs = None
    
            self.create_node(tag=desc, identifier=id)
    
            for i in childs:
                self.paste(self.id, i)
    
        def getSons(self):
            sons = self.children(self.id)
            return sons
    
        def getID(self):
            return self.id
    
        def getDesc(self):
            return self.desc
    
        def show(self):
            self.show(key=lambda x: x.tag, reverse=True, line_type='ascii-em')
    
    class Get(Tree):
    
        def __init__(self, id, desc, primitive, *args, **kwargs):
    
            Tree.__init__(self, *args, **kwargs)
    
            self.id = id
            self.desc = desc
            self.parent = None
            self.primitive = primitive
    
            self.create_node(tag=desc, identifier=id, data=primitive)
    
        def getID(self):
            return self.id
    
        def getDesc(self):
            return self.desc
    
        def show(self):
            self.show(key=lambda x: x.tag, reverse=True, line_type='ascii-em')
    
    class Primitive():
    
        def __init__(self, value):
            self.value = value
    
        def getValue(self):
            return self.value
    
        def show(self):
            pass
            #print '\t -> ' + str(self.value)
    

If, for example, I do this on another .py

    
    
    prim = Primitive(0)
    get1 = Get("get1", "Some random thing", prim)
    get1.show()
    

it tells me that `key` is an unexpected argument. I even checked the library's
.py file, the argument is there:

    
    
    def show(self, nid=None, level=ROOT, idhidden=True, filter=None,
             key=None, reverse=False, line_type='ascii-ex'):
    

The `create_node()` method works just fine! That's what's weird. Any
suggestions?

I'm using `treelib` in **Python 2.7**


Answer: Your method `show()` calls itself:

    
    
    def show(self):
        self.show(key=lambda x: x.tag, reverse=True, line_type='ascii-em')
    

Removed it in `Get` and change it in `Join` to:

    
    
    def show(self):
        super(Join, self).show(key=lambda x: x.tag, reverse=True, line_type='ascii-em')
    

