Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python class arbitrary arguments

class Bar(object):
    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)
        
>>> bar = Bar(a=1, b=2)
>>> bar.a
1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #class #arbitrary #arguments
ADD COMMENT
Topic
Name
4+8 =