getattrfunc vs. tp_methods

Fabiano Sidler fabianosidler at gmail.com
Fri Nov 3 16:26:00 EST 2006


Hello list!

Writing a C extension module, which way is better to implement attribute
retrieval, by a getattr function in the PyTypeObject struct or by an entry
tp_methods? I don't need any black magic being executed on attribute access,
so I would tend towards the tp_methods entry. Any argument against it?

Greetings,
Fips



More information about the Python-list mailing list