docs: def _sethex(self, hexstring):
          """Reset the bitstring to have the value given in hexstring."""
          hexstring = tidy_input_string(hexstring)
          # remove any 0x if present
          hexstring = hexstring.replace('0x', '')
          length = len(hexstring)
          if length % 2:
              hexstring += '0'
          try:
              try:
                  data = bytearray.fromhex(hexstring)
              except TypeError:
                  # Python 2.6 needs a unicode string (a bug). 2.7 and 3.x work fine.
                  data = bytearray.fromhex(unicode(hexstring))
          except ValueError:
              raise CreationError("Invalid symbol in hex initialiser.")
          self._setbytes_unsafe(data, length * 4, 0)