missing types in module types?

M

Manlio Perillo

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top