def map(self, func):
        """Inplace map transformation of a binary tree."""
        for tree in self.subtree():
            tree.cargo = func(tree.cargo)
Inplace map transformation of a binary tree.
recipes/Python/136529_Trees_and_more_trees/recipe-136529.py