Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

class chain methods python

class foo():
    def __init__(self, kind=None):
        self.kind = kind
    def my_print(self):
        print (self.kind)
        return self
    def line(self):
        self.kind = 'line'
        return self
    def bar(self):
        self.kind='bar'
        return self
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #class #chain #methods #python
ADD COMMENT
Topic
Name
4+5 =