I just got a chance to look at this, and I like it, but have one
suggestion. From a usage standpoint, wouldn't it be simpler to have
the decorator just be the signal name, like @pre_save? I can't see any
situation where you'd use a decorator for anything but connecting, so
the ".connect" part just seems unnecessary.
This could be implemented easily by adding a __call__() method to Signal.
-Justin
That's a win. Anyone against?
I just sat using the dispatcher from Django in a project of mine, and
was stunned at
__call__ not being *send*. So no, no __call__ decorator.
-- Ludvig
Preferably not; it's far easier to keep track of a threaded discussion
here on the mailing list, as opposed to trying to follow it in the
ticket.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
Yes, so if we decide to go ahead and include decorator functionality, we
have two ways to go:
@signal.decorate
def f(...): ...
- or -
@signal_decorator(signal)
def f(...): ...
I'm not sure which is more Pythonic or which I prefer, considering
Python
mixes and matches these two styles. (math.sqrt, str.encode, etc.)
Ludvig Ericson
ludvig....@gmail.com