Code

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#9243 closed (fixed)

Document Signal.connect weak parameter

Reported by: ekellner Owned by: kkubasik
Component: Documentation Version: 1.0
Severity: Keywords: signals kkmegapatch
Cc: ekellner@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

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.

Attachments (1)

signals.txt (600 bytes) - added by ekellner 6 years ago.
doc patch

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by ekellner

doc patch

comment:1 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by kkubasik

  • Keywords kkmegapatch added
  • Owner changed from nobody to kkubasik

comment:3 Changed 5 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [10303]) A whole lotta documentation fixes: Fixes #8704, #8826, #8980, #9243, #9343, #9529,

comment:12 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.