I actually like design when constructors use as little arguments as possible, ideally none at all - this benefits your later when you can instantiate objects prior to knowing all the initialization parameters. When you absolutely have to use arguments for constructors, it's best when child class can assure that parent constructor will receive valid arguments no matter how child's constructor gets called. In your case, the valid ways to extend constructor with required arguments are either:

# add one more argument to child constructor
def__init__(arg1,arg2,arg3):
AClass.__init__(arg1,arg2)


or

# reduce amount of arguments via supplying value from elsewhere
def__init__(arg2,arg3):
AClass.__init__("iAlreadyKnowArg1ValueAtConstructionTime",arg2)



On 2010.10.27 14:55, Erkan Özgür Yılmaz wrote:

so my question is, is it good/safe/nice to use *args, **kwargs and pass them to the super of BClass to avoid repeating the arguments of the parent class (AClass)?

--
Viktoras
www.neglostyti.com

--
http://groups.google.com/group/python_inside_maya

Reply via email to