I know how to implement method chaining in Python within a single class, but I'm wondering if there is a way to chain methods from different classes, something like:
class C1:
def sayHello(self):
print "hello from c1"
return self
class C2:
def sayHello(self):
print "hello from c2"
return self
c1 = C1()
c2 = C2()
(c1.sayHello()).(c2.sayHello())
Output:
hello from c1
hello from c2
Any ideas?