[SciPy-User] check where method is defined

josef.pktd at gmail.com josef.pktd at gmail.com
Thu Jun 16 10:59:23 EDT 2011


What's the best way to check in which class or super class a method is defined ?

I would like to write some tests that only apply if the specific
distribution class defines the method.

For example: Is _sf defined in the specific distribution class or is
it the generic implementation in the superclass, rv_continuous

>>> stats.gengamma._sf
<bound method gengamma_gen._sf of
<scipy.stats.distributions.gengamma_gen object at 0x05679470>>

Josef



More information about the SciPy-User mailing list