find an object ancestor

Chris Rebert clp at rebertia.com
Wed Nov 5 22:14:37 EST 2008


On Sun, Nov 2, 2008 at 1:16 PM, Michel Perez <opsbat at infomed.sld.cu> wrote:
> HI all:
>
> imagine something like this:
>
> class father:
>    pass
> class son( father ):
>    pass
>
> I need to know the son ancestor class how can i know this.

Help on built-in function issubclass in module __builtin__:

issubclass(...)
    issubclass(C, B) -> bool

    Return whether class C is a subclass (i.e., a derived class) of class B.
    When using a tuple as the second argument issubclass(X, (A, B, ...)),
    is a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.).

Cheers,
Chris
-- 
Follow the path of the Iguana...
http://rebertia.com

>
> Thanks
>
>
> ---------------------------------------
>    Red Telematica de Salud - Cuba
>          CNICM - Infomed
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list