Explorar o código

Update docs/userguide/signals.rst

add a note about where undocumented keyword parameter (e.g. signal) comes from when implementing a handler.
w- %!s(int64=12) %!d(string=hai) anos
pai
achega
65b82a70fa
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      docs/userguide/signals.rst

+ 6 - 0
docs/userguide/signals.rst

@@ -46,6 +46,12 @@ has been sent by providing the `sender` argument to
                           kwargs=None, **kwds):
         print('Got signal task_sent for task id {0}'.format(task_id)
 
+Signals use the same implementation as django.core.dispatch. As a result other
+keyword parameters (e.g. signal) are passed to all signal handlers by default.
+
+The best practice for signal handlers is to accept arbitrary keyword arguments (**kwargs.
+That way new celery versions can add additional arguments without breaking user code.
+
 .. _signal-ref:
 
 Signals