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-31.05:18:15
SpamBayes Score 0.043896176
Marked as misclassified No
Message-id <1193807896.2.0.80210956861.issue1252@psf.upfronthosting.co.za>
In-reply-to
Content
> 1) Should Delegator delegate calls to callables

No, I agree they should.  The question is whether it's necessary to add a 
__call__() method to the Delegator class.  I claim you can do what you want 
to do without it.  It serves only one purpose that I can see: you want to 
delegate to a callable by calling the instance at the top of the chain, and 
one of the chain members isn't callable.  I don't see a use case for that, 
YAGNI.

I'll defer the Percolator discussion for now.  There is more to it than just 
the inheritance issue.

I found your example1.py to be confusing.  Please stop using the word 
'delegator', it's too overloaded in this discussion!

I marked up example1.py as example1a.py, changing some names and adding some 
comments.

I also worked up example2.py which seems to cover the possible combinations 
of proxying functions, callables, and methods.  It works without adding 
__call__() to Delegator.  Please check it out, what more do you need?

I'll be away until Sunday, so I can't respond further until then.
History
Date User Action Args
2007-10-31 05:18:16kbksetspambayes_score: 0.0438962 -> 0.043896176
recipients: + kbk, taleinat
2007-10-31 05:18:16kbksetspambayes_score: 0.0438962 -> 0.0438962
messageid: <1193807896.2.0.80210956861.issue1252@psf.upfronthosting.co.za>
2007-10-31 05:18:16kbklinkissue1252 messages
2007-10-31 05:18:15kbkcreate