Re: [Tutor] Inheritance in classes

2014-04-08 Thread Steven D'Aprano
On Tue, Apr 08, 2014 at 11:14:36AM +0530, Santosh Kumar wrote: > Can i mask the parent attibutes in the child. let me give a quick example. > > In [1]: class a: >...: value1 = 1 >...: value2 = 2 >...: > > In [2]: class b(a): >...: value3 = 3 >...: All of value1, v

Re: [Tutor] Inheritance in classes

2014-04-08 Thread David Palao
2014-04-08 7:44 GMT+02:00 Santosh Kumar : > Can i mask the parent attibutes in the child. let me give a quick example. > > In [1]: class a: >...: value1 = 1 >...: value2 = 2 >...: > > In [2]: class b(a): >...: value3 = 3 >...: > > In [3]: obj1 = b() > > In [4]: obj1.

Re: [Tutor] Inheritance in classes

2014-04-08 Thread Alan Gauld
On 08/04/14 06:44, Santosh Kumar wrote: Can i mask the parent attibutes in the child. let me give a quick example. In [1]: class a: ...: value1 = 1 ...: value2 = 2 ...: In [2]: class b(a): ...: value3 = 3 ...: Note that these are class variables and not instan

[Tutor] Inheritance in classes

2014-04-07 Thread Santosh Kumar
Can i mask the parent attibutes in the child. let me give a quick example. In [1]: class a: ...: value1 = 1 ...: value2 = 2 ...: In [2]: class b(a): ...: value3 = 3 ...: In [3]: obj1 = b() In [4]: obj1.value1 Out[4]: 1 In [5]: obj1.value2 Out[5]: 2 In [6]: obj1.valu