def _setdata(self, data):
        """Setter for self.data; will only accept a string or None type."""
        if not isinstance(data, (str, bytes)) and not isinstance(data, type(None)):
            raise TypeError("value must be a subclass of string or None, "
                            "not %s" % type(data))
        self._data = data
Setter for self.data; will only accept a string or None type.
recipes/Python/576662_icmplib/recipe-576662.py