INNER CODE UNIT · Python
_make_FormattedSeq_table
pydna-group/pydna · src/pydna/__init__.py:221
def _make_FormattedSeq_table() -> bytes:
table = bytearray(256)
upper_to_lower = ord("A") - ord("a")
for c in b"ABCDEFGHIJKLMNOPQRSTUVWXYZ": # Only allow IUPAC letters
table[c] = c # map uppercase to uppercase
table[c - upper_to_lower] = c # map lowercase to uppercase
return bytes(table)
FormattedSeq._table = _make_FormattedSeq_table()