title: Python class design: explicit keyword arguments vs. **kwargs vs. @property
body: <p>Is there a generally accepted best practice for creating a class whose instances will have many (non-defaultable) variables?</p>
  
  <p>For example, by explicit arguments:</p>
  
  <pre><code>class Circle(object):
      def __init__(self,x,y,radius):
          self.x = x
          self.y = y
          self.radius = radius
  </code></pre>
  
  <p>using **kwargs:</p>
  
  <pre><code>class Circle(object):
      def __init__(self, **kwargs):
          if 'x' in kwargs:
              self.x = kwargs['x']
          if 'y' in kwargs:
              self.y = kwargs['y']
          if 'radius' in kwargs:
              self.radius = kwargs['radius']
  </code></pre>
  
  <p>or using properties:</p>
  
  <pre><code>class Circle(object):
      def __init__(self):
          pass
  
      @property
      def x(self):
          return self._x
  
      @x.setter
      def x(self, value):
          self._x = value
  
      @property
      def y(self):
          return self._y
  
      @y.setter
      def y(self, value):
          self._y = value
  
      @property
      def radius(self):
          return self._radius
  
      @radius.setter
      def radius(self, value):
          self._radius = value
  </code></pre>
  
  <p>For classes which implement a small number of instance variables (like the example above), it seems like the natural solution is to use explicit arguments, but this approach quickly becomes unruly as the number of variables grows. Is there a preferred approach when the number of instance variables grows lengthy?</p>