From 5dc9eabbf7b1c5d6b6757e33a9b345b4a8ba2317 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 12 Nov 2024 15:05:39 -0600 Subject: [PATCH] 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__. --- scripts/code.py | 2 +- scripts/cov.py | 4 ++-- scripts/csv.py | 6 +++--- scripts/data.py | 2 +- scripts/perf.py | 2 +- scripts/perfbd.py | 2 +- scripts/stack.py | 2 +- scripts/structs.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index 1586aa0c..b22973a1 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -119,7 +119,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): diff --git a/scripts/cov.py b/scripts/cov.py index ec5f6af3..ef600a20 100755 --- a/scripts/cov.py +++ b/scripts/cov.py @@ -120,7 +120,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): @@ -192,7 +192,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): diff --git a/scripts/csv.py b/scripts/csv.py index 2bd29bac..5c65d63c 100755 --- a/scripts/csv.py +++ b/scripts/csv.py @@ -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): diff --git a/scripts/data.py b/scripts/data.py index c60e8892..25351106 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -119,7 +119,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): diff --git a/scripts/perf.py b/scripts/perf.py index 85218f2b..0eee8be7 100755 --- a/scripts/perf.py +++ b/scripts/perf.py @@ -128,7 +128,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): diff --git a/scripts/perfbd.py b/scripts/perfbd.py index 6ece974d..3ee67b47 100755 --- a/scripts/perfbd.py +++ b/scripts/perfbd.py @@ -119,7 +119,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): diff --git a/scripts/stack.py b/scripts/stack.py index 3df30859..ef1090f0 100755 --- a/scripts/stack.py +++ b/scripts/stack.py @@ -109,7 +109,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): diff --git a/scripts/structs.py b/scripts/structs.py index c0368c13..50d12c97 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -114,7 +114,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):