def from_str(cls, s):
        """ Accepts both the output of to_simple_str() and __str__(). """
        if not isinstance(s, str):
            raise TypeError("Expected an str instance, received %r" % (s,))
        return cls(cls.bits_from_str(s))
Accepts both the output of to_simple_str() and __str__().