Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace int2byte from six with string literals or bytes(...) #28748

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

foolip
Copy link
Member

@foolip foolip commented Apr 29, 2021

The following expressions were evaluated as True in a Python 3.8.2 shell
to gain confidence:

from six import int2byte
b"".join(int2byte(byte) for byte in range(255)) == bytes(range(255))
int2byte(0xff) == b"\xff"
int2byte(0x83) + int2byte(0x65) + int2byte(0x83) + int2byte(0x58) + int2byte(0x83) + int2byte(0x67) == bytes([0x83, 0x65, 0x83, 0x58, 0x83, 0x67])
b'<' + int2byte(0xff) + b'/>' == b'<\xff/>'

The following expressions were evaluated as True in a Python 3.8.2 shell
to gain confidence:
```py
from six import int2byte
b"".join(int2byte(byte) for byte in range(255)) == bytes(range(255))
int2byte(0xff) == b"\xff"
int2byte(0x83) + int2byte(0x65) + int2byte(0x83) + int2byte(0x58) + int2byte(0x83) + int2byte(0x67) == bytes([0x83, 0x65, 0x83, 0x58, 0x83, 0x67])
b'<' + int2byte(0xff) + b'/>' == b'<\xff/>'
```
Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@foolip foolip merged commit 9c4b5c0 into master Apr 29, 2021
@foolip foolip deleted the foolip/int2byte branch April 29, 2021 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants