def to_dict(self):
        """Converts dynstruct to a dictionary.  """
        dyn_dict = {}
        for (key, val) in six.iteritems(self.__dict__):
            if key not in self._printable_exclude:
                dyn_dict[key] = val
        return dyn_dict