Re: [Tutor] Trouble understanding modifying parent class..

2009-04-14 Thread Alan Gauld
"Eric Dorsey" wrote class A: def __init__(self, name, value=1): self.name = name self.value = value And now I want a subclass, one that overrides the value=1 and defaults to value=2, how do I code that? I'm understanding subclasses that have different methods that have differ

Re: [Tutor] Trouble understanding modifying parent class..

2009-04-13 Thread Guillaume Chereau
On Tue, Apr 14, 2009 at 11:27 AM, Eric Dorsey wrote: > Hi tutors, I am studying classes a bit, and am having trouble with this > concept and would appreciate your help! > > > class A: >     def __init__(self, name, value=1): >     self.name = name >     self.value = value > > And now I wan

[Tutor] Trouble understanding modifying parent class..

2009-04-13 Thread Eric Dorsey
Hi tutors, I am studying classes a bit, and am having trouble with this concept and would appreciate your help! class A: def __init__(self, name, value=1): self.name = name self.value = value And now I want a subclass, one that overrides the value=1 and defaults to value=2, h