-
-
Notifications
You must be signed in to change notification settings - Fork 944
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
Provide annotations for kombu/utils/encoding.py
#2208
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2208 +/- ##
==========================================
- Coverage 81.54% 81.52% -0.03%
==========================================
Files 77 77
Lines 9517 9527 +10
Branches 1154 1158 +4
==========================================
+ Hits 7761 7767 +6
Misses 1564 1564
- Partials 192 196 +4 ☔ View full report in Codecov by Sentry. |
The initial annotations provided aim to annotate the current implementation opposed to potentially refactoring to narrow down the original intention of the provided implementations.
for more information, see https://pre-commit.ci
4f51694
to
2a911cd
Compare
def _safe_str( | ||
s: object, | ||
errors: str = 'replace', | ||
file: Any = None |
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 places say Any
and some object
.
Is there any specific reason for not using the same annotation all over?
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.
See comments
Linked Issue: #1511
For this PR, I aimed to annotate the existing implementation of the encoding functions, regardless of what I thought the function's intention is.
There are some functions e.g.
str_to_bytes
,bytes_to_str
, orsafe_str
which I think may have potentially misleading implementations. I'm not sure whether this is under the scope of this PR, input on this would be appreciated :).