Opened 18 years ago
Closed 18 years ago
#4521 closed (wontfix)
signals should have __(str|repr)__ for debugging/maintenance.
Reported by: | (removed) | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django.dispatch.dispatcher.An(y|onymous) singletons derive from a 'Parameter' class, basically providing a default repr, docstring. Useful for those signals, but should be generalized so that it's usable for other custom signals for any poor folks trying to yet again optimize dispatch :)
Attached is a patch adding a custom _signal class; it's not required for creation of a specific signal to connect to, merely advisable- adds in str/repr automatically (and docstring if supplied) making things a bit simpler for folks debugging.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | signal-class.patch added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
We're going to end up taking some variation on #4561 and that includes this functionality. So let's punt this exact patch and push the other one to completion.
add django.dispatch.signal func to return a singleton with docstring/label bound in, and usable (str|repr)