-
Notifications
You must be signed in to change notification settings - Fork 247
utils.py: fix types in docstrings for base64url_encode/decode #269
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #269 +/- ##
=======================================
Coverage 92.94% 92.94%
=======================================
Files 15 15
Lines 1418 1418
=======================================
Hits 1318 1318
Misses 100 100 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
good fix for the same issue I'm having with PyCharm warning that I'm passing bytes as well as my initial confusion getting an exception when passing a string. I'm not sure why this PR hasn't been merged yet. |
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.
Pull Request Overview
This PR updates the docstring parameter types for the base64url_encode
and base64url_decode
helpers to correctly reflect that they operate on bytes, not strings.
- Changed the
input
parameter type in both functions fromstr
tobytes
in docstrings. - Adjusted descriptions to indicate byte inputs rather than string inputs.
@@ -67,7 +67,7 @@ def base64url_decode(input): | |||
"""Helper method to base64url_decode a string. | |||
|
|||
Args: | |||
input (str): A base64url_encoded string to decode. | |||
input (bytes): A base64url_encoded string (bytes) to decode. |
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.
[nitpick] The docstring repeats the type and uses 'base64url_encoded string'; consider simplifying to bytes: base64url-encoded value to decode.
input (bytes): A base64url_encoded string (bytes) to decode. | |
input (bytes): base64url-encoded value to decode. |
Copilot uses AI. Check for mistakes.
@@ -82,7 +82,7 @@ def base64url_encode(input): | |||
"""Helper method to base64url_encode a string. | |||
|
|||
Args: | |||
input (str): A base64url_encoded string to encode. | |||
input (bytes): A base64url_encoded string (bytes) to encode. |
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.
The description incorrectly implies the input is already encoded. It should read something like bytes: raw data to encode using base64url.
input (bytes): A base64url_encoded string (bytes) to encode. | |
input (bytes): Raw binary data (bytes) to encode using base64url. |
Copilot uses AI. Check for mistakes.
No description provided.