Skip to content

Commit

Permalink
Update the Scrapy 2.8 release notes up to b337c98
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Jan 31, 2023
1 parent 52ba45e commit 1135ed0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ New features
avoid confusion.
(:issue:`5717`, :issue:`5722`, :issue:`5727`)

- The ``callback`` parameter of :class:`~scrapy.http.Request` can now be set
to :func:`scrapy.http.request.NO_CALLBACK`, to distinguish it from
``None``, as the latter indicates that the default spider callback
(:meth:`~scrapy.Spider.parse`) is to be used.
(:issue:`5798`)


Bug fixes
~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/topics/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ Request objects
- ``None`` (default), which indicates that the spider's
:meth:`~scrapy.Spider.parse` method must be used.

- :py:data:`scrapy.http.request.NO_CALLBACK`

.. autodata:: scrapy.http.request.NO_CALLBACK
- :func:`~scrapy.http.request.NO_CALLBACK`

For more information, see
:ref:`topics-request-response-ref-request-callback-arguments`.
Expand Down Expand Up @@ -247,6 +245,8 @@ Request objects
Other functions related to requests
-----------------------------------

.. autofunction:: scrapy.http.request.NO_CALLBACK

.. autofunction:: scrapy.utils.request.request_from_dict


Expand Down
6 changes: 6 additions & 0 deletions scrapy/http/request/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ def NO_CALLBACK(*args, **kwargs):
:class:`~scrapy.http.Request`, it indicates that the request is not meant
to have a spider callback at all.
For example:
.. code-block:: python
Request("https://example.com", callback=NO_CALLBACK)
This value should be used by :ref:`components <topics-components>` that
create and handle their own requests, e.g. through
:meth:`scrapy.core.engine.ExecutionEngine.download`, so that downloader
Expand Down

0 comments on commit 1135ed0

Please sign in to comment.