missing types in module types?

Discussion in 'Python' started by Manlio Perillo, May 29, 2004.

  1. Hi.

    I have found that some types are missing from module types:


    import types
    from types import *

    def check_type(obj):
    type_list = [eval(t) for t in dir(types) if t.endswith('Type')]
    return [[x, type(obj)] for x in type_list if isinstance(obj, x)]


    def fun(): pass

    cm = classmethod(fun)
    sm = staticmethod(fun)

    p = property()


    print check_type(cm)
    [[<type 'object'>, <type 'classmethod'>]]

    print check_type(sm)
    [[<type 'object'>, <type 'staticmethod'>]]

    print check_type(fun.__init__)
    [[<type 'object'>, <type 'method-wrapper'>]]

    print check_type(p)
    [[<type 'object'>, <type 'property'>]]



    Regards Manlio Perillo
    Manlio Perillo, May 29, 2004
    #1
    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. Maric Michaud
    Replies:
    0
    Views:
    7,185
    Maric Michaud
    Jun 24, 2006
  2. Gary Herron
    Replies:
    2
    Views:
    662
    Bruno Desthuilliers
    Jul 4, 2006
  3. John Nagle

    Types missing from "types"module

    John Nagle, Jun 24, 2010, in forum: Python
    Replies:
    6
    Views:
    330
    Terry Reedy
    Jun 24, 2010
  4. Will Gillen

    Consuming External WSD (WebReference), Missing a few types

    Will Gillen, May 7, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    171
    Will Gillen
    May 7, 2008
  5. Rick Johnson
    Replies:
    39
    Views:
    430
    Neil Cerutti
    Feb 27, 2012
Loading...

Share This Page