Python: how to inherite and override
- by Guy
Consider this situation:
I get an object of type A which has the function f. I.e:
class A:
def f():
print 'in f'
def h():
print 'in h'
and I get an instance of this class but I want to override the f function but save the rest of the functionality of A. So what I was thinking was something of the sort:
class B(A):
....
…