Le Monday 09 June 2008 17:28:45 [EMAIL PROTECTED], vous avez écrit : > So, is there any way to inspect a method to see where (in what class) > it > is defined?
In [56]: class a(object) : def a() : return def b() : return ....: ....: In [59]: class b(a) : def b() : return def c() : return ....: ....: In [62]: i=b() In [63]: for m in 'a', 'b', 'c' : ....: print [ t for t in type(i).mro() if m in dir(t) ] ....: ....: [<class '__main__.a'>] [<class '__main__.b'>, <class '__main__.a'>] [<class '__main__.b'>] mro stands for "method resolution order", check the reference on this and "super", it worths the effort. -- _____________ Maric Michaud _____________ Aristote - www.aristote.info 3 place des tapis 69004 Lyon Tel: +33 4 26 88 00 97 Mobile: +33 6 32 77 00 21 -- http://mail.python.org/mailman/listinfo/python-list