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:
Christopher Haster
2024-11-12 15:05:39 -06:00
parent 02881faf6f
commit 5dc9eabbf7
8 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
+2 -2
View File
@@ -120,7 +120,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
@@ -192,7 +192,7 @@ class RFrac(co.namedtuple('RFrac', 'a,b')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.a * other.a, self.b * other.b) 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) return self.__class__(self.a // other.a, self.b // other.b)
def __mod__(self, other): def __mod__(self, other):
+3 -3
View File
@@ -113,7 +113,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
@@ -206,7 +206,7 @@ class RFloat(co.namedtuple('RFloat', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x / other.x) return self.__class__(self.x / other.x)
def __mod__(self, other): def __mod__(self, other):
@@ -278,7 +278,7 @@ class RFrac(co.namedtuple('RFrac', 'a,b')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.a * other.a, self.b * other.b) 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) return self.__class__(self.a // other.a, self.b // other.b)
def __mod__(self, other): def __mod__(self, other):
+1 -1
View File
@@ -119,7 +119,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
+1 -1
View File
@@ -128,7 +128,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
+1 -1
View File
@@ -119,7 +119,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
+1 -1
View File
@@ -109,7 +109,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):
+1 -1
View File
@@ -114,7 +114,7 @@ class RInt(co.namedtuple('RInt', 'x')):
def __mul__(self, other): def __mul__(self, other):
return self.__class__(self.x * other.x) return self.__class__(self.x * other.x)
def __div__(self, other): def __truediv__(self, other):
return self.__class__(self.x // other.x) return self.__class__(self.x // other.x)
def __mod__(self, other): def __mod__(self, other):