[Tutor] Basic class inheritance

Alan G alan.gauld at freenet.co.uk
Thu Jul 28 19:48:25 CEST 2005

>> Now I want that another class, call it B, inherits all
>> behaviours/attributes except for the attribute blank, that now I 
>> want
>> to be False.

> class B(A):
>  def __init__(self, blank=True, editable=True, name='foo'):
>    A.__init__(self, blank, editable, name)

except that instead of passimng blank to A.__init__ you should pass 
That way blank will always be False as required! ie:

     A.__init__(self, False, editable, name)


Alan G. 

More information about the Tutor mailing list