-
Notifications
You must be signed in to change notification settings - Fork 11k
changing dunder-str to dunder-repr #5150
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 Report
@@ Coverage Diff @@
## master #5150 +/- ##
==========================================
+ Coverage 84.16% 88.90% +4.73%
==========================================
Files 162 162
Lines 10524 10964 +440
Branches 1522 1799 +277
==========================================
+ Hits 8858 9747 +889
+ Misses 1406 936 -470
- Partials 260 281 +21
|
scrapy/core/http2/stream.py
Outdated
@@ -151,11 +151,9 @@ def _cancel(_) -> None: | |||
|
|||
self._deferred_response = Deferred(_cancel) | |||
|
|||
def __str__(self) -> str: | |||
def __repr__(self): |
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.
Should the typing be added here too?
scrapy/http/request/__init__.py
Outdated
@@ -121,11 +121,9 @@ def _set_body(self, body: Optional[Union[str, bytes]]) -> None: | |||
def encoding(self) -> str: | |||
return self._encoding | |||
|
|||
def __str__(self) -> str: | |||
def __repr__(self): |
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.
Should the typing be added here too?
What:
Changing all dunder-str to dunder-repr
Why:
Some __repr__ were being set as __repr__ = __str__, we actually dont need this because if the compiler does not find __str__, then it will get __repr__ as an alternative.
Proof:
https://onecompiler.com/python/3wxqqch57