mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
str.translate requires a Mapping or Sequence (in essence, anything with __getitem__), not a Dict. str.maketrans in the one-argument form only converts character string keys to their unicode ordinal, leaving any of the values untouched. This mapping may use both integers or strings as keys at the same time. str.maketrans in the multi-argument form returns a dict with any of the values str, int or None, as recognized by str.translate.