title: Overwrite __sub__ for a-b when 'b' is my class
body: <p>I have a class <code>foo</code> that is essentially a float with some extra attributes attached. I can overwrite its <code>__sub__</code> method so that I can do subtraction one direction, but I can't figure out how to do it the other way:</p>
  
  <pre><code>class foo():
      def __init__(self, value, otherstuff):
          self.value = value
          self.otherstuff = otherstuff
  
      def __sub__(self, other):
          return self.value - other
  
  a = 5
  b = foo(12, 'blue')
  print b-a  # this works fine and returns 7
  print a-b  # I want this to return -7 but it obviously doesn't work
  </code></pre>
  
  <p>Is there a way to do this?</p>
  
  <p>A general solution for add, sub, mul, div would be ideal, but sub and div are most pressing since they're not reversible.</p>