How to pass variables to getattr

前端 未结 0 2000
礼貌的吻别
礼貌的吻别 2021-01-11 15:10

I need to call a class method by name, and pass any arguments. Below is an example of what I am try to do:

class C:
    def m(self, s, l=1):
        return &q         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题