1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Boo: def bu(self, y): return 1 + y class Foo: def fu(self): return Boo() x = 0 print(x) x = Foo().fu()\ .bu(x) print(x) x=2 print(x)