[C++-sig] Re: Re: wrapping complex attributes

David Abrahams dave at boost-consulting.com
Thu Nov 14 02:54:52 CET 2002


"Mike Rovner" <mike at bindkey.com> writes:

> "David Abrahams" <dave at boost-consulting.com> wrote in message
> news:ud6p93xsx.fsf at boost-consulting.com...
>> >   # now I want 3 more members
>> >   def __init__(self):
>> >     self.x=tcn_helper(self.getX, self.delX, self.newX, self.getXall)
>> >     self.y=tcn_helper(self.getY, self.delY, self.newY, self.getYall)
>> >     self.z=tcn_helper(self.getZ, self.delZ, self.newZ, self.getZall)
>>
>> In order for the Pure Python code to help you with the C++ version,
>> you need to use the same idioms. You'll need x,y, and z to be
>> properties on the class instead of attributes on the instance. Make
>> them into properties and try again. See
>
> I don't want them to be properties. I hope I'm not forced :)

Oh, well. I tried to help.

> If I recall correctly 'setattr' add attributes to object dictionary.
>
> I want x,y,z to behave the way I want, not to be something. ;)

Good luck to you!

-- 
                       David Abrahams
   dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution





More information about the Cplusplus-sig mailing list