How to call a property of the base class if this property is being overwritten in the derived class?

You might think you could call the base class function which is called by property: class FooBar(Foo): @property def bar(self): # return the same value # as in the base class return Foo.bar(self) Though this is the most obvious thing to try I think – it does not work because bar is a property, not … Read more

Understanding __get__ and __set__ and Python descriptors

The descriptor is how Python’s property type is implemented. A descriptor simply implements __get__, __set__, etc. and is then added to another class in its definition (as you did above with the Temperature class). For example: temp=Temperature() temp.celsius #calls celsius.__get__ Accessing the property you assigned the descriptor to (celsius in the above example) calls the … Read more