Skip to content

Question about a design pattern in Chapter 18 #21

Description

@justinblaber

Maybe not the best forum to ask this, but I have a question about this part in the AVL tree section:

def put(self, key, value):
    newroot = BalancedBSTNode.put(self, key, value)
    update(newroot)
    return newroot.rebalance()

I've never seen this design pattern before... is this called something? Like "recursive inheritance"? I think it's awesome and also a little mind bending. I would have never thought about extending recursive methods like this...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions