-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Closed as not planned
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
bytearray.maketrans() returns a bytes
type value instead of a bytearray
type value as shown below:
table = bytearray.maketrans(b'abc', b'xyz')
table = bytearray.maketrans(bytearray(b'abc'), bytearray(b'xyz'))
print(type(table)) # <class 'bytes'>
So, bytearray.maketrans()
should return a bytearray
type value like below:
table = bytearray.maketrans(b'abc', b'xyz')
table = bytearray.maketrans(bytearray(b'abc'), bytearray(b'xyz'))
print(type(table)) # <class 'bytearray'>
In addition, bytes.maketrans() returns a bytes
type value properly as shown below:
table = bytes.maketrans(b'abc', b'xyz')
table = bytes.maketrans(bytearray(b'abc'), bytearray(b'xyz'))
print(type(table)) # <class 'bytes'>
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error