Message56987
> 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. |
|
| Date |
User |
Action |
Args |
| 2007-10-31 05:18:16 | kbk | set | spambayes_score: 0.0438962 -> 0.0438962 recipients:
+ kbk, taleinat |
| 2007-10-31 05:18:16 | kbk | set | spambayes_score: 0.0438962 -> 0.0438962 messageid: <1193807896.2.0.80210956861.issue1252@psf.upfronthosting.co.za> |
| 2007-10-31 05:18:16 | kbk | link | issue1252 messages |
| 2007-10-31 05:18:15 | kbk | create | |
|