'Instantiate this node class from another node, properly
copying over all attributes that one would forget otherwise.'

@classmethod
def from_node(cls, node, **kwargs):

    attributes = 'cf_state    cf_maybe_null    cf_is_null    constant_result'.split()
    for attr_name in attributes:
        if (attr_name in kwargs):
            continue
        try:
            value = getattr(node, attr_name)
        except AttributeError:
            pass
        else:
            kwargs[attr_name] = value
    return cls(node.pos, **kwargs)
