title: require named parameters in python function
body: <p>I have created a class and I would like to give the user (probably me) two different ways to initialize it. For this example the class is called <code>Box</code> and I would like to initialize it with either:</p>
  
  <ol>
  <li><p>two sets of Cartesian coordinates, representing the min and max (x,y).</p></li>
  <li><p>a set of Cartesian coordinates representing the min and the box dimensions</p></li>
  </ol>
  
  <p>I can do this by using named parameters, however I would like to raise an error if no named parameter is called.  My current code puts a dummy parameter in called <code>pass_var</code> in the case that no named parameter is called.  It works, but I think there must be a more elegant or Pythonic solution.</p>
  
  <pre><code>class Box(object):
  
      def __init__(self, pass_var=None, coordinates=None, min_points=None, dimensions=None):
          if coordinates:
              setup_box_from_coordinates()
              return
          elif min_points and dimensions:
              setup_box_from_dimensions()
              return
          raise NameError("Box Class needs to be initiated with 'coordinates='' or 'min_pts= &amp; dimensions='"
  </code></pre>