python check if object is callable