mirror of https://github.com/scrapy/scrapy.git
changing dunder-str to dunder-repr
This commit is contained in:
parent
ee682af3b0
commit
5bacc4822e
|
|
@ -150,12 +150,10 @@ class Stream:
|
|||
self.close(StreamCloseReason.CANCELLED)
|
||||
|
||||
self._deferred_response = Deferred(_cancel)
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
||||
def __repr__(self):
|
||||
return f'Stream(id={self.stream_id!r})'
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
@property
|
||||
def _log_warnsize(self) -> bool:
|
||||
"""Checks if we have received data which exceeds the download warnsize
|
||||
|
|
|
|||
|
|
@ -109,11 +109,9 @@ class Request(object_ref):
|
|||
def encoding(self):
|
||||
return self._encoding
|
||||
|
||||
def __str__(self):
|
||||
def __repr__(self):
|
||||
return f"<{self.method} {self.url}>"
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
def copy(self):
|
||||
"""Return a copy of this Request"""
|
||||
return self.replace()
|
||||
|
|
|
|||
|
|
@ -87,11 +87,9 @@ class Response(object_ref):
|
|||
|
||||
body = property(_get_body, obsolete_setter(_set_body, 'body'))
|
||||
|
||||
def __str__(self):
|
||||
def __repr__(self):
|
||||
return f"<{self.status} {self.url}>"
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
def copy(self):
|
||||
"""Return a copy of this Response"""
|
||||
return self.replace()
|
||||
|
|
|
|||
|
|
@ -51,11 +51,9 @@ class SettingsAttribute:
|
|||
self.value = value
|
||||
self.priority = priority
|
||||
|
||||
def __str__(self):
|
||||
def __repr__(self):
|
||||
return f"<SettingsAttribute value={self.value!r} priority={self.priority}>"
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
|
||||
class BaseSettings(MutableMapping):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -106,11 +106,9 @@ class Spider(object_ref):
|
|||
if callable(closed):
|
||||
return closed(reason)
|
||||
|
||||
def __str__(self):
|
||||
def __repr__(self):
|
||||
return f"<{type(self).__name__} {self.name!r} at 0x{id(self):0x}>"
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
|
||||
# Top-level imports
|
||||
from scrapy.spiders.crawl import CrawlSpider, Rule
|
||||
|
|
|
|||
Loading…
Reference in New Issue