Where is PyMethod_GET_CLASS in Python 3?

Infinity77 andrea.gavana at gmail.com
Tue Dec 15 11:08:01 EST 2009


Hi All,

    When building C extensions In Python 2.X, there was a magical
PyMethod_GET_CLASS implemented like this:

#define PyMethod_GET_CLASS(meth) \
	(((PyMethodObject *)meth) -> im_class)

It looks like Python 3 has wiped out the "im_class" attribute. Which
is the alternative was to handle this case in Python 3? How do I find
to which class this particular method belongs to? BTW, it's very,
very, *very* hard to find any possible reference to help migrating
existing C extensions from Python 2.X to Python 3.

Thank you for your suggestions.

Andrea.



More information about the Python-list mailing list