[py] treat function as objects