I have a code snippet like this
class A(object):
class b:
def print_hello(self):
print "Hello world"
b = property(b)
And I want to override the inner class b
(please dont worry about the lowercase name) behaviour. Say, I want to add a new method or I want to change an existing method, like:
class C(A):
class b(A.b):
def print_hello(self):
print "Inner Class: Hello world"
b = property(b)
Now if I create C
's object as c = C()
, and call c.b
I get TypeError: 'property' object is not callable error
. How would I get pass this and call print_hello
of the extended inner class? Disclaimer: I dont want to change the code for A
class.
Update: The base class 'A' tries to simulate a class which I have seen in one of the opensource apis. So thats why I dont want to change the core api, but extend it for my own requirement.