title: Using Python tuples as vectors
body: <p>I need to represent immutable vectors in Python  ("vectors" as in linear algebra, not as in programming).  The tuple seems like an obvious choice.</p>
  
  <p>The trouble is when I need to implement things like addition and scalar multiplication.  If <code>a</code> and <code>b</code> are vectors, and <code>c</code> is a number, the best I can think of is this:</p>
  
  <pre><code>tuple(map(lambda x,y: x + y, a, b)) # add vectors 'a' and 'b'
  tuple(map(lambda x: x * c, a))      # multiply vector 'a' by scalar 'c'
  </code></pre>
  
  <p>which seems inelegant; there should be a clearer, simpler way to get this done -- not to mention avoiding the call to <code>tuple</code>, since <code>map</code> returns a list.</p>
  
  <p>Is there a better option?  </p>