File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 77
88from collections import Iterable
99from numbers import Integral
10+ import string
1011
1112from future .utils import istext , isbytes , PY3 , with_metaclass
1213from future .types import no , issubset
@@ -372,7 +373,6 @@ def strip(self, bytes_to_strip=None):
372373 """
373374 return newbytes (super (newbytes , self ).strip (bytes_to_strip ))
374375
375- @no (unicode )
376376 def lower (self ):
377377 """
378378 b.lower() -> copy of b
@@ -390,5 +390,18 @@ def upper(self):
390390 """
391391 return newbytes (super (newbytes , self ).upper ())
392392
393+ @classmethod
394+ @no (unicode )
395+ def maketrans (cls , frm , to ):
396+ """
397+ B.maketrans(frm, to) -> translation table
398+
399+ Return a translation table (a bytes object of length 256) suitable
400+ for use in the bytes or bytearray translate method where each byte
401+ in frm is mapped to the byte at the same position in to.
402+ The bytes objects frm and to must be of the same length.
403+ """
404+ return newbytes (string .maketrans (frm , to ))
405+
393406
394407__all__ = ['newbytes' ]
You can’t perform that action at this time.
0 commit comments