/[escript]/trunk/escript/py_src/unitsSI.py
ViewVC logotype

Diff of /trunk/escript/py_src/unitsSI.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3771 by jfenwick, Wed Jan 18 02:30:48 2012 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 204  class Unit(object): Line 204  class Unit(object):
204         else:         else:
205            return self(other)            return self(other)
206    
207     def __div__(self,other):     #Need this for python2      
208       def __div__(self, other):
209           return self.__truediv__(other)
210    
211       def __truediv__(self,other):
212         """         """
213         Performs self*other operation for two `Unit` objects         Performs self*other operation for two `Unit` objects
214    
# Line 222  class Unit(object): Line 226  class Unit(object):
226                return _DivUnit(self.getName()+"/"+other.getName(),self.getLongName()+"/"+other.getLongName(),0 , self(1.)/other(1.))                return _DivUnit(self.getName()+"/"+other.getName(),self.getLongName()+"/"+other.getLongName(),0 , self(1.)/other(1.))
227         else:         else:
228            return NotImplemented            return NotImplemented
229     def __rdiv__(self,other):  
230       #Need this for python2      
231       def __rdiv__(self, other):
232           return self.__rtruediv__(other)          
233              
234       def __rtruediv__(self,other):
235         """         """
236         Performs other/self operation         Performs other/self operation
237    

Legend:
Removed from v.3771  
changed lines
  Added in v.3892

  ViewVC Help
Powered by ViewVC 1.1.26