Chris Colbert wrote:
> On Tue, May 19, 2009 at 5:17 PM, Robert Bradshaw wrote:
>>>> def testload(filename):
>>>>     cdef IplImage* img = load(filename)
>>>>     cdef PyIplImage pyimg = PyIplImage
>>>>     pyimg.img = img
>>>>     return pyimg
>
> it seems a little "off" to programatically set every attribute one
> by one every time i create an instance of that type.

Just write a factory function to do it for you. That's actually a common
(and recommended) pattern.

> Is it not recommended to declare a property for every attribute I want
> access from in python?

If all you need is plain value access, that's what they are made for.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to