Opened 9 years ago

Closed 9 years ago

#4521 closed (wontfix)

signals should have __(str|repr)__ for debugging/maintenance.

Reported by: (removed) Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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)

signal-class.patch (2.8 KB) - added by (removed) 9 years ago.
add django.dispatch.signal func to return a singleton with docstring/label bound in, and usable (str|repr)

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by (removed)

Attachment: signal-class.patch added

add django.dispatch.signal func to return a singleton with docstring/label bound in, and usable (str|repr)

comment:1 Changed 9 years ago by Malcolm Tredinnick

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 9 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top