阅读背景:

如果对象是任何函数类型,是否有一种常见的方法来检查Python?

来源:互联网 

I have a function in Python which is iterating over the attributes returned from dir(obj), and I want to check to see if any of the objects contained within is a function, method, built-in function, etc. Normally you could use callable() for this, but I don't want to include classes. The best I've come up with so far is:I have a function in Python which is iterating




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: