Fixed #31327 -- Deprecated providing_args argument for Signal.

This commit is contained in:
Jon Dufresne 2020-03-01 09:22:03 -08:00 committed by Carlton Gibson
parent 5ca76baa72
commit 769cee5252
12 changed files with 68 additions and 47 deletions

View file

@ -58,6 +58,9 @@ details on these changes.
``django.utils.deprecation.MiddlewareMixin.__init__()`` will be required and
won't accept ``None``.
* The ``providing_args`` argument for ``django.dispatch.Signal`` will be
removed.
See the :ref:`Django 3.1 release notes <deprecated-features-3.1>` for more
details on these changes.

View file

@ -546,6 +546,11 @@ Miscellaneous
older versions of Django. Support for the old format remains until Django
4.0.
* The purely documentational ``providing_args`` argument for
:class:`~django.dispatch.Signal` is deprecated. If you rely on this
argument as documentation, you can move the text to a code comment or
docstring.
.. _removed-features-3.1:
Features removed in 3.1

View file

@ -216,24 +216,17 @@ its own signals.
Defining signals
----------------
.. class:: Signal(providing_args=list)
.. class:: Signal()
All signals are :class:`django.dispatch.Signal` instances. The
``providing_args`` is a list of the names of arguments the signal will provide
to listeners. This is purely documentational, however, as there is nothing that
checks that the signal actually provides these arguments to its listeners.
All signals are :class:`django.dispatch.Signal` instances.
For example::
import django.dispatch
pizza_done = django.dispatch.Signal(providing_args=["toppings", "size"])
pizza_done = django.dispatch.Signal()
This declares a ``pizza_done`` signal that will provide receivers with
``toppings`` and ``size`` arguments.
Remember that you're allowed to change this list of arguments at any time, so
getting the API right on the first try isn't necessary.
This declares a ``pizza_done`` signal.
Sending signals
---------------