Python: Inherit the superclass __init__

前端 未结 7 912
囚心锁ツ
囚心锁ツ 2020-12-01 02:51

I have a base class with a lot of __init__ arguments:

class BaseClass(object):
    def __init__(self, a, b, c, d, e, f, ...):
        self._a=a+         


        
7条回答
  •  难免孤独
    2020-12-01 03:11

    super(SubClass, self).__init__(...)
    

    Consider using *args and **kw if it helps solving your variable nightmare.

提交回复
热议问题