[Python-3000] Help replacing Py_FindMethod

Amaury Forgeot d'Arc amauryfa at gmail.com
Tue Jul 29 16:32:47 CEST 2008


Jesus Cea wrote:
> Amaury Forgeot d'Arc wrote:
> | I think you were close, you just have to be careful to call
> | PyType_Ready in the module init function,
> | to create the descriptors for each tp_methods and tp_members entries.
>
> Already done :). Thanks for answering.
>
> My doubt now is how do write a *clever* "getattr" routine without
> "Py_FindMethod".

Well, I'd write a "tp_getattro" member function,
which would do its "clever" things before it falls back to
PyObject_GenericGetAttr to get the usual behaviour.

Or did you mean something more "clever"?

-- 
Amaury Forgeot d'Arc


More information about the Python-3000 mailing list