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
chore(pipelined): More mypy fixes #12884
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
…atting" Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
cookie (int): a hex cookie value for the request | ||
cookie_mask (int): a hex cookie mask for the request |
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.
What does "hex" mean in this context?
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.
Good question. I meant things like this which is input to the function I've modified here, for example.
Note that Python seems to consider it to be an integer as I have declared here:
>>> OVS_COOKIE_MATCH_ALL = 0xffffffff
>>> type(OVS_COOKIE_MATCH_ALL)
<class 'int'>
though the built-in hex function actually returns strings:
>>> int(str(OVS_COOKIE_MATCH_ALL), 0)
4294967295
>>> hex(4294967295)
'0xffffffff'
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.
All right, so it is just an int for Python. I guess they write it in hexadecimal because the variable is used as a bitmask.
cookie (int): a hex cookie value for the request | ||
cookie_mask (int): a hex cookie mask for the request |
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.
All right, so it is just an int for Python. I guess they write it in hexadecimal because the variable is used as a bitmask.
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.
LGTM.
* chore(pipelined): Remove commented out print statements Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com> * chore(pipelined): Fix "Not all arguments converted during string formatting" Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com> * chore(pipelined): Fix 'Function "builtins.hex" is not valid as a type' Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com> * chore(pipelined): Fix incompatible argument with superclass Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com> * chore(pipelined): Fix "Incompatible types in assignment" Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com> * chore(pipelined): Remove more commented out code Signed-off-by: Cameron Voisey <cameron.voisey@tngtech.com>
Summary
Follow up to #12833 and #12875.
Test Plan
bazel test lte/gateway/python/magma/pipelined/...
./bazel/scripts/run_sudo_tests.sh lte/gateway/python/magma/pipelined/