from typing import Tuple PAT = r"""'(?:[sdmt]|ll|ve|re)| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+""" def to_bytes_tuple(word: str) -> Tuple[bytes]: l = list(word.encode("utf-8")) l = [bytes([x]) for x in l] return tuple(l)