This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kbk
Recipients kbk, taleinat
Date 2007-10-24.19:34:29
SpamBayes Score 0.02118405
Marked as misclassified No
Message-id <1193254470.66.0.423033503729.issue1252@psf.upfronthosting.co.za>
In-reply-to
Content
Despite your explanation, I don't understand what is being
accomplished here.  Delegates are not intended to be callable.
They have methods, e.g. insert, which are callable, and the
insert call is propagated down the chain by calls like
(from ColorDelegator):

    def insert(self, index, chars, tags=None):
        index = self.index(index)
        self.delegate.insert(index, chars, tags)
        self.notify_range(index, index + "+%dc" % len(chars))

IMHO it's an incorrect usage of the Delegator mixin to
affect the callable nature of the class to which it's being added.

Also, this __call__ method, if actually used, propagates to the
end of the Delegator chain and calls the function at the end,
(assuming it is a function).  Or it will skip non-callable
Delegators and stop at the first callable one.

I doubt this is what was intended, and people trying to understand the code 
will be further confused, it seems to me.

Try adding delegator.txt (below) to your Delegator.py and running the
module!

I think this patch increases the complexity and obscurity of the
Delegator/Percolator/WidgetRedirector code, rather than improving
it.  Apparently you want to sometimes call a chain of methods (as
in current usage) and sometimes call a chain of functions. The
semantic overload, which was bad enough already, is too great.

If Squeezer and ShellLogger require this change, then I'd
suggest changing them to match current Percolator usage, instead.
Currently I don't see a Delegator being used in Squeezer.  Could
you be more specific about why the change is needed for those
two extensions?
Files
File name Uploaded
delegator.txt kbk, 2007-10-24.19:34:29
History
Date User Action Args
2007-10-24 19:34:30kbksetspambayes_score: 0.021184 -> 0.02118405
recipients: + kbk, taleinat
2007-10-24 19:34:30kbksetspambayes_score: 0.021184 -> 0.021184
messageid: <1193254470.66.0.423033503729.issue1252@psf.upfronthosting.co.za>
2007-10-24 19:34:30kbklinkissue1252 messages
2007-10-24 19:34:29kbkcreate