missing types in module types?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Manlio Perillo

    missing types in module types?

    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('Typ e')]
    return [[x, type(obj)] for x in type_list if isinstance(obj, x)]


    def fun(): pass

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

    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
Working...