Re: Automatic delegation in Python 3

2010-09-08 Thread Steven D'Aprano
On Wed, 08 Sep 2010 15:45:46 -0400, Terry Reedy wrote: [...] >> Unfortunately, I need to use delegation, not inheritance, and I need to >> use a new-style class, since I will be using Python 3. How can I do >> automatic delegation in Python 3? Is my only hope to give up on

Re: Automatic delegation in Python 3

2010-09-08 Thread Thomas Jollans
e. Yes, special methods are looked up on the type. So you have to make sure the type has the methods. > > Unfortunately, I need to use delegation, not inheritance, and I need to > use a new-style class, since I will be using Python 3. How can I do > automatic delegation in Python

Re: Automatic delegation in Python 3

2010-09-08 Thread Terry Reedy
eing the cost. Unfortunately, I need to use delegation, not inheritance, and I need to use a new-style class, since I will be using Python 3. How can I do automatic delegation in Python 3? Is my only hope to give up on the elegance of automatic delegation, and code all the special methods as manual

Automatic delegation in Python 3

2010-09-08 Thread Steven D'Aprano
instance, for new-style classes, but I'm not entirely sure. Unfortunately, I need to use delegation, not inheritance, and I need to use a new-style class, since I will be using Python 3. How can I do automatic delegation in Python 3? Is my only hope to give up on the elegance of automatic