[Cython] __getattribute__
Robert Bradshaw
robertwb at math.washington.edu
Thu May 1 03:17:31 CEST 2008
On Apr 29, 2008, at 5:42 PM, Peter Todd wrote:
> Is there a __getattribute__ work-alike in Cython?
>
> Essentially I need direct control over an objects tp_getattro and
> tp_setattro slots to implement a wrapper class. Specificly
> wrapped.__class__ should go to the wrapped objects class attribute,
> not
> the wrapping objects __class__ attribute.
>
> __getattr__ outputs C-source that includes a call to
> PyObject_GenericGetAttr first, and won't run my code if that call
> succeeds.
>
> Thanks,
>
> Peter
Not that I'm aware of, though I'd imagine that implementing
__getattribute__ (if it exists) as being called at the top of this
function would be fairly easy to do. One would want to match Python
symantics exactly.
- Robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080430/e5d1c3c1/attachment-0001.pgp
More information about the Cython-dev
mailing list