Python Test If Object Is Function