Identify object class

Discussion in 'Python' started by Nicolas Fleury, Oct 14, 2003.

  1. Hi,
    How do we quickly identify in Python if an object is of a specific
    class *or* is of a class deriving directly or indirectly from that class?

    BTW, don't you think this newsgroup has a lot of activity and it should
    be time to make other newsgroups like comp.lang.python.windows, etc?

    Thx and Regards,

    Nicolas Fleury
    Nicolas Fleury, Oct 14, 2003
    #1
    1. Advertising

  2. Nicolas Fleury

    Carl Banks Guest

    Nicolas Fleury wrote:
    > Hi,
    > How do we quickly identify in Python if an object is of a specific
    > class *or* is of a class deriving directly or indirectly from that class?



    You want the isinstance built-in function. Example:

    if isinstance(obj,cls): do_whatever()


    > BTW, don't you think this newsgroup has a lot of activity and it should
    > be time to make other newsgroups like comp.lang.python.windows, etc?



    Good idea! I propose the following:

    comp.lang.python.misc
    comp.lang.python.gui
    comp.lang.python.networking
    comp.lang.python.dev
    comp.lang.python.lisp-envy


    --
    CARL BANKS http://www.aerojockey.com/software

    As the newest Lady Turnpot descended into the kitchen wrapped only in
    her celery-green dressing gown, her creamy bosom rising and falling
    like a temperamental souffle, her tart mouth pursed in distaste, the
    sous-chef whispered to the scullery boy, "I don't know what to make of
    her."
    --Laurel Fortuner, Montendre, France
    1992 Bulwer-Lytton Fiction Contest Winner
    Carl Banks, Oct 14, 2003
    #2
    1. Advertising

  3. Nicolas Fleury

    Terry Reedy Guest

    "Nicolas Fleury" <_remove_the_> wrote in message
    news:niXib.92072$...

    > BTW, don't you think this newsgroup has a lot of activity and it

    should
    > be time to make other newsgroups like comp.lang.python.windows, etc?


    The volume goes up and down, I believe (through probably trending up).
    The last two weeks have been up withthe x lisp threads.

    The idea of division has come up occasionally for several years, but
    never any agreement on what the split might be. Also, there are about
    50 specialized Python mailing lists. Go to news.gmane.org which
    gateways lists to its own newsgroups and look as gmane.comp.python.*.

    Terry J. Reedy
    Terry Reedy, Oct 14, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,716
    Thomas Weidenfeller
    Oct 12, 2005
  2. Nedron
    Replies:
    5
    Views:
    7,474
    asimkhan
    Jul 6, 2011
  3. Replies:
    9
    Views:
    558
    justanotherguy
    Dec 3, 2004
  4. Sergio Correia
    Replies:
    7
    Views:
    281
    Ben Finney
    Sep 18, 2007
  5. JC
    Replies:
    5
    Views:
    430
Loading...

Share This Page