Document Signal.connect weak parameter
|Reported by:||ekellner||Owned by:||Kevin Kubasik|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django signals keep a weak reference to the signal handler. If you handler is a local function, it will be garbage collected. There is a name parameter in Signal.connect, so you can put weak=False to stop this, but this functionality appears to be undocumented.
It would be nice if this was mentioned somewhere in the signals documentation, since when your signal handler is garbage collected, it is silently not called and it's not trivial to figure out what's going on.
Change History (5)
comment:2 Changed 8 years ago by
|Owner:||changed from nobody to Kevin Kubasik|