how to chain methods i n pytohn clases

Solutions on MaxInterview for how to chain methods i n pytohn clases by the best coders in the world

showing results for - "how to chain methods i n pytohn clases"
Henry
09 Jun 2016
1class foo():
2    def __init__(self, kind=None):
3        self.kind = kind
4    def my_print(self):
5        print (self.kind)
6        return self
7    def line(self):
8        self.kind = 'line'
9        return self
10    def bar(self):
11        self.kind='bar'
12        return self