Re: Why can't access the property setter using the super?

2019-03-19 Thread Chris Angelico
On Wed, Mar 20, 2019 at 6:17 AM Arup Rakshit wrote: > > Hello Ian, > > That seems like too much code involved. Is this how we do write inheritance > in Python. Coming from Ruby and JS world I find Python inheritance mechanism > confusing so far. :/ > > Ian gave the longhand form, but you can om

Re: Why can't access the property setter using the super?

2019-03-19 Thread Arup Rakshit
Hello Ian, That seems like too much code involved. Is this how we do write inheritance in Python. Coming from Ruby and JS world I find Python inheritance mechanism confusing so far. :/ Thanks, Arup Rakshit a...@zeit.io > On 19-Mar-2019, at 9:32 PM, Ian Kelly wrote: > > Here's the thing:

Re: Why can't access the property setter using the super?

2019-03-19 Thread Ian Kelly
Here's the thing: the result of calling super() is not an instance of the base class. It's just a proxy object with a __getattribute__ implementation that looks up class attributes in the base class, and knows how to pass self to methods to simulate calling base class methods on an instance. This w

Why can't access the property setter using the super?

2019-03-19 Thread Arup Rakshit
I have 3 classes which are connected to them through inheritance as you see in the below code: import iso6346 class ShippingContainer: """docstring for ShippingContainer""" HEIGHT_FT = 8.5 WIDTH_FT = 8.0 next_serial = 1337 @classmethod def _get_next_serial(cls):