'This is called to create a new instance of this class when we need new
Nodes (or subclasses) in the internal code in this class. Normally, it
just shadows __init__(). However, subclasses with an __init__ signature
that is not an extension of Node.__init__ might need to implement this
method to allow a Node to create a new instance of them (if they have
any extra setting up to do).'

def _new_instance(cls, children=None, connector=None, negated=False):

    obj = SearchNode(children, connector, negated)
    obj.__class__ = cls
    return obj
