'Return previous child in parent\'s children, or None.'

def get_prev_sibling(self):

    if (self.parent is None):
        return None
    for (i, child) in enumerate(self.parent.children):
        if (child is self):
            if (i == 0):
                return None
            return self.parent.children[(i - 1)]
