ffi/vector.py
def _apply_op(self, op, other, swap=False): # {{{1
    "Apply an operator to self and other"
    if isinstance(other, Vec):
      p1 = self.as_array()
      p2 = other.as_array()
    else:
      p1 = self.as_array()
      p2 = other
    if swap:
      p1, p2 = p2, p1
    return Vec(op(p1, p2))
Apply an operator to self and other
Apply an operator to self and other
Apply an operator to self and other
def _apply_op(self, op, other, swap=False): 
    if isinstance(other, Vec):
      p1 = self.as_array()
      p2 = other.as_array()
    else:
      p1 = self.as_array()
      p2 = other
    if swap:
      p1, p2 = p2, p1
    return Vec(op(p1, p2))
def _apply_op ( self , op , other , swap = False ) : if isinstance ( other , Vec ) : p1 = self . as_array ( ) p2 = other . as_array ( ) else : p1 = self . as_array ( ) p2 = other if swap : p1 , p2 = p2 , p1 return Vec ( op ( p1 , p2 ) )
Apply an operator to self and other
Apply an operator to self and other
# {{{1 "Apply an operator to self and other"
self
op
other
swap