from types import MethodType,FunctionType def check(arg): """ 检查arg是方法还是函数? :param arg: :return: """ if isinstance(arg,MethodType): print('arg是一个方法') elif isinstance(arg,FunctionType): print('arg是一个函数') else: print('不知道是什么')
检查arg是方法还是函数?
猜你喜欢
转载自www.cnblogs.com/apollo1616/p/9776051.html
今日推荐
周排行