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

Look at using from_bytes #1367

Closed
dopplershift opened this issue May 2, 2020 · 0 comments · Fixed by #1476
Closed

Look at using from_bytes #1367

dopplershift opened this issue May 2, 2020 · 0 comments · Fixed by #1476
Labels
Area: IO Pertains to reading data Type: Maintenance Updates and clean ups (but not wrong)
Milestone

Comments

@dopplershift
Copy link
Member

Python 3.2 added int.from_bytes, which allows easily generating an integer value from the bytes--and we can use it now that we're only Python >= 3.6.

I doubt we should replace all usages of struct with this, but there are some places in the binary I/O code where we do some jumping through struct hoops just to form a couple of integers. This would certainly be clearer--we'd also want to do a bit of benchmarking to see if there's any performance ramifications.

@dopplershift dopplershift added Area: IO Pertains to reading data Type: Maintenance Updates and clean ups (but not wrong) labels May 2, 2020
This was referenced Aug 24, 2020
dopplershift added a commit to dopplershift/MetPy that referenced this issue Aug 26, 2020
Update it to use Python 3's int.from_bytes() method.
dopplershift added a commit to dopplershift/MetPy that referenced this issue Aug 26, 2020
Update it to use Python 3's int.from_bytes() method.
@dopplershift dopplershift added this to the 1.0 milestone Aug 26, 2020
dopplershift added a commit to dopplershift/MetPy that referenced this issue Oct 2, 2020
Update it to use Python 3's int.from_bytes() method.
dopplershift added a commit to dopplershift/MetPy that referenced this issue Oct 2, 2020
Update it to use Python 3's int.from_bytes() method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: IO Pertains to reading data Type: Maintenance Updates and clean ups (but not wrong)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant