-
Notifications
You must be signed in to change notification settings - Fork 570
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 binascii and struct with native Python methods #2582
base: master
Are you sure you want to change the base?
Replace binascii and struct with native Python methods #2582
Conversation
Signed-off-by: vibhatsu <[email protected]>
Signed-off-by: vibhatsu <[email protected]>
Signed-off-by: vibhatsu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these changes i like, such as the hex conversions. those are much cleaner.
but the migration from using struct doesn't seem as clear cut. what benefits do the new code constructs bring? i find the lines much noisier (lots of repeated kwargs) and therefore hard to read. given that struct is a built in Python module, i don't yet understand the desire to remove it here. can you explains a bit @v1bh475u ?
I also felt that way but thought the issue wished for removing dependency of struct. Personally, I feel struct code looks much cleaner wherever |
that would be great! then we can continue to discuss struct vs int separately. |
This reverts commit 483f8c9.
Done with changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these look great. please give yourself some credit in the changelog!
under what header should I add? |
bug fixes |
Signed-off-by: vibhatsu <[email protected]>
I agree with the fact that the repeated kwargs make the code not easy to read.
That's exactly my initial thought when suggesting to use int. Generally speaking, struct is usually used to pack a lot of data together with longer format strings (See discussion here around the use of struct vs int https://stackoverflow.com/a/56799074) For consistency, let's keep using struct for now |
Checklist
closes #2327