Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use int.from_bytes instead of implementing the conversion ourselves. #27288

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

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 8, 2023

int.from_bytes has been around since Python 3.2.

PR summary

PR checklist

int.from_bytes has been around since Python 3.2.
for b in buf[1:]:
value = 0x100*value + b
return value
return int.from_bytes(self.file.read(nbytes), "big", signed=signed)
Copy link
Member

Choose a reason for hiding this comment

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

Should the file pointer be wrapped in a with statement, or does it get cleaned up in the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its lifetime is managed by the Dvi object.

@ksunden ksunden added this to the v3.9.0 milestone Nov 8, 2023
@ksunden ksunden merged commit caa7d42 into matplotlib:main Nov 8, 2023
@anntzer anntzer deleted the ifb branch November 8, 2023 23:13
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.

3 participants