Is there a nice way to check whether object o is a builtin Python function?
I know I can use, for example
type(o) == type(pow)
because type(pow) is ‘builtin_function_or_method’.
But is there some nicer way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The types module:
Though, if you look under the hood, you’ll find it’s not that different from what you’re doing now.
So, in your case, use