Apply suggestions from code review

Co-authored-by: Adrián Chaves <adrian@chaves.io>
This commit is contained in:
Andrey Rakhmatullin 2023-08-02 19:46:16 +04:00 committed by GitHub
parent 72462a53e2
commit af1be835e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ to do so is by setting their :attr:`~scrapy.Spider.custom_settings` attribute:
"SOME_SETTING": "some value",
}
It's often better to provide a :meth:`~scrapy.Spider.update_settings` instead,
It's often better to implement :meth:`~scrapy.Spider.update_settings` instead,
and settings set there should use the "spider" priority explicitly:
.. code-block:: python
@ -94,8 +94,8 @@ and settings set there should use the "spider" priority explicitly:
@classmethod
def update_settings(cls, settings):
settings.set("SOME_SETTING", "some value", priority="spider")
super().update_settings(settings)
settings.set("SOME_SETTING", "some value", priority="spider")
3. Project settings module
--------------------------

View File

@ -162,7 +162,7 @@ scrapy.Spider
settings, spider attributes or other factors and use setting priorities
other than ``'spider'``. Also, it's easy to extend ``update_settings()``
in a subclass by overriding it, while doing the same with
:attr:`~scrapy.Spider.custom_settings` is hard or impossible.
:attr:`~scrapy.Spider.custom_settings` can be hard.
For example, suppose a spider needs to modify :setting:`FEEDS`:
@ -182,8 +182,8 @@ scrapy.Spider
@classmethod
def update_settings(cls, settings):
settings.setdefault("FEEDS", {}).update(cls.custom_feed)
super().update_settings(settings)
settings.setdefault("FEEDS", {}).update(cls.custom_feed)
.. method:: start_requests()