def items(self):
        'DictMixin does this; but it can be done faster by the base class'
        ans = [(self.key, self.value)]
        if self.left is not None: ans.extend(self.left.items())
        if self.right is not None:  ans.extend(self.right.items())
        return ans
DictMixin does this; but it can be done faster by the base class
recipes/Python/117236_Dictionary_Mixin__Framework/recipe-117236.py