KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How to check if a function is a method of some object? For example: def check_method(f): ... check_method(lambda x: x + 1) # >>> False check_method(SomeClass().some_method) # >>> True There are some special attributes in methods in my 'helloworld' example (e.g. 'im_self', '__self__' etc). Can I rely on them or there is some nicer way?
Tags (comma-separated)
Save Edits
Cancel