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