diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-01-05 00:53:30 -0500 |
---|---|---|
committer | Warren Weckesser <warren.weckesser@gmail.com> | 2020-01-05 00:53:30 -0500 |
commit | c31cc36a8a814ed4844a2a553454185601914a5a (patch) | |
tree | adb28a762dc0985eed669db75b564b3f5c3bfbcc /benchmarks | |
parent | c1f1bc9ce8e4e2936e80d9bfafc3d8e03237a84b (diff) | |
download | numpy-c31cc36a8a814ed4844a2a553454185601914a5a.tar.gz |
MAINT: Remove implicit inheritance from object class (#15236)
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/benchmarks/bench_function_base.py | 2 | ||||
-rw-r--r-- | benchmarks/benchmarks/bench_overrides.py | 2 | ||||
-rw-r--r-- | benchmarks/benchmarks/bench_ufunc.py | 2 | ||||
-rw-r--r-- | benchmarks/benchmarks/common.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/benchmarks/benchmarks/bench_function_base.py b/benchmarks/benchmarks/bench_function_base.py index 3b4647773..b1e592749 100644 --- a/benchmarks/benchmarks/bench_function_base.py +++ b/benchmarks/benchmarks/bench_function_base.py @@ -104,7 +104,7 @@ def memoize(f): return f -class SortGenerator(object): +class SortGenerator: # The size of the unsorted area in the "random unsorted area" # benchmarks AREA_SIZE = 100 diff --git a/benchmarks/benchmarks/bench_overrides.py b/benchmarks/benchmarks/bench_overrides.py index f03120efa..e44951785 100644 --- a/benchmarks/benchmarks/bench_overrides.py +++ b/benchmarks/benchmarks/bench_overrides.py @@ -33,7 +33,7 @@ def mock_concatenate(arrays, axis=0, out=None): pass -class DuckArray(object): +class DuckArray: def __array_function__(self, func, types, args, kwargs): pass diff --git a/benchmarks/benchmarks/bench_ufunc.py b/benchmarks/benchmarks/bench_ufunc.py index 73159bd97..9f45a7257 100644 --- a/benchmarks/benchmarks/bench_ufunc.py +++ b/benchmarks/benchmarks/bench_ufunc.py @@ -150,7 +150,7 @@ class Scalar(Benchmark): (self.y + self.z) -class ArgPack(object): +class ArgPack: __slots__ = ['args', 'kwargs'] def __init__(self, *args, **kwargs): self.args = args diff --git a/benchmarks/benchmarks/common.py b/benchmarks/benchmarks/common.py index c6037dea9..3fd81a164 100644 --- a/benchmarks/benchmarks/common.py +++ b/benchmarks/benchmarks/common.py @@ -110,5 +110,5 @@ def get_indexes_rand_(): return indexes_rand_ -class Benchmark(object): +class Benchmark: goal_time = 0.25 |