In <mailman.272.1293215190.6505.python-l...@python.org> Daniel Urban <urban.d...@gmail.com> writes:
>On Fri, Dec 24, 2010 at 17:24, kj <no.em...@please.post> wrote: >> (BTW, I don't understand why inspect doesn't provide something as >> basic as the *class* that the method belongs to, whenever applicable. >> I imagine there's a good reason for this coyness, but I can't figure >> it out.) >One function object can "belong to" (be in the namespace of) more than >one class, so there is no "the class". There are many other properties that inspect reports on (e.g. filename) that may not apply to an individual case. For 99.9% of methods, the class in which it was lexically defined would be good enough. -- http://mail.python.org/mailman/listinfo/python-list