scripts: csv.py: Fixed use of __div__ vs __truediv__
Not sure if this is an old habit from Python 2, or just because it looks nicer next to __mul__, __mod__, etc, but in Python 3 this should be __truediv__ (or __floordiv__), not __div__.
This commit is contained in:
+3
-3
@@ -113,7 +113,7 @@ class RInt(co.namedtuple('RInt', 'x')):
|
||||
def __mul__(self, other):
|
||||
return self.__class__(self.x * other.x)
|
||||
|
||||
def __div__(self, other):
|
||||
def __truediv__(self, other):
|
||||
return self.__class__(self.x // other.x)
|
||||
|
||||
def __mod__(self, other):
|
||||
@@ -206,7 +206,7 @@ class RFloat(co.namedtuple('RFloat', 'x')):
|
||||
def __mul__(self, other):
|
||||
return self.__class__(self.x * other.x)
|
||||
|
||||
def __div__(self, other):
|
||||
def __truediv__(self, other):
|
||||
return self.__class__(self.x / other.x)
|
||||
|
||||
def __mod__(self, other):
|
||||
@@ -278,7 +278,7 @@ class RFrac(co.namedtuple('RFrac', 'a,b')):
|
||||
def __mul__(self, other):
|
||||
return self.__class__(self.a * other.a, self.b * other.b)
|
||||
|
||||
def __div__(self, other):
|
||||
def __truediv__(self, other):
|
||||
return self.__class__(self.a // other.a, self.b // other.b)
|
||||
|
||||
def __mod__(self, other):
|
||||
|
||||
Reference in New Issue
Block a user