Warn that signal receivers are weakly-referenced

For the signal get_generators in particular, it may seem natural to use
a lambda or inner function as the signal receiver, but this does not
work as the receiver is collected before it can be called.
This commit is contained in:
Tom Most 2014-06-29 20:05:12 -07:00
commit 1b02ff79a7

View file

@ -57,6 +57,12 @@ which you map the signals to your plugin logic. Let's take a simple example::
def register():
signals.initialized.connect(test)
.. note::
Signal receivers are weakly-referenced, thus, they must not be defined
within your ``register`` callable or they will be garbage-collected before
the signal is emitted.
List of signals
===============