How to pass through Python args and kwargs?

后端 未结 2 1078
甜味超标
甜味超标 2021-01-07 22:43

While I have a general understanding (I think) of Python\'s *args and **kwargs, I\'m having trouble understanding how to pass them from one function through to another. Her

2条回答
  •  再見小時候
    2021-01-07 23:24

    You pass them with syntax mirroring the argument syntax:

    self.save_name_for(*args, **kwargs)
    

    Note that you do not need to pass in self; save_name_for is already bound.

提交回复
热议问题