In section 10.1, Table 10.1 "Operations on Bytes and Bytearrays":
s.maketrans(x [, y [, z]]) Makes a translation table for s.translate().
For bytes and bytearray, maketrans() takes two arguments: maketrans(frm, to, /)
And further down, in Table 10.9 "String Operators and Methods", you have:
s.translate(table [, deletechars]) Translates a string using a character translation table table, removing characters in deletechars.
According to the docs, the optional second parameter (delete) is a bytes/bytearray thing, while str.translate only takes one (mandatory) argument: translate(self, table, /)
In section 10.1, Table 10.1 "Operations on Bytes and Bytearrays":
For
bytesandbytearray,maketrans()takes two arguments:maketrans(frm, to, /)And further down, in Table 10.9 "String Operators and Methods", you have:
According to the docs, the optional second parameter (
delete) is abytes/bytearraything, whilestr.translateonly takes one (mandatory) argument:translate(self, table, /)