def copy(self, cls = None):
            """Shallow copy of a tree.

            An extra class argument can be given to copy with a different
            (tree) class. No checks are made on the class."""
            if cls is None:
                cls = self.__class__
            if self:
                subtrees = tuple([subtree.copy(cls) for subtree in \
                                  self.subtrees])
                return cls(self.cargo, *subtrees)
            else:
                return cls()
Shallow copy of a tree.

            An extra class argument can be given to copy with a different
            (tree) class. No checks are made on the class.
recipes/Python/201423_Trees_and_more_trees_part_II/recipe-201423.py