def remove_trait(self, name):
        """Overrides HasTraits definition of remove_trait in order to
        keep track of dynamically added traits for serialization.
        """
        try:
            del self._added_traits[name]
        except KeyError:
            pass
        try:
            del self._cached_traits_[name]
        except (__HOLE__, TypeError):
            pass
        try:
            del self._trait_metadata[name]
        except KeyError:
            pass

        super(Container, self).remove_trait(name)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/container.py/Container.remove_trait