diff options
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/_exceptions.py | 2 | ||||
-rw-r--r-- | numpy/core/arrayprint.py | 4 | ||||
-rw-r--r-- | numpy/core/memmap.py | 4 | ||||
-rw-r--r-- | numpy/core/records.py | 6 | ||||
-rw-r--r-- | numpy/core/tests/test_arrayprint.py | 6 | ||||
-rw-r--r-- | numpy/core/tests/test_regression.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_umath.py | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/numpy/core/_exceptions.py b/numpy/core/_exceptions.py index 5e17ed3b2..77aa2f6e1 100644 --- a/numpy/core/_exceptions.py +++ b/numpy/core/_exceptions.py @@ -135,7 +135,7 @@ class AxisError(ValueError, IndexError): if msg_prefix is not None: msg = "{}: {}".format(msg_prefix, msg) - super(AxisError, self).__init__(msg) + super().__init__(msg) @_display_as_base diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index 5c1d6cb63..3251c51e3 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -1253,12 +1253,12 @@ class DatetimeFormat(_TimelikeFormat): self.legacy = legacy # must be called after the above are configured - super(DatetimeFormat, self).__init__(x) + super().__init__(x) def __call__(self, x): if self.legacy == '1.13': return self._format_non_nat(x) - return super(DatetimeFormat, self).__call__(x) + return super().__call__(x) def _format_non_nat(self, x): return "'%s'" % datetime_as_string(x, diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index 892ad2540..b0d9cb3af 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -316,7 +316,7 @@ class memmap(ndarray): self.base.flush() def __array_wrap__(self, arr, context=None): - arr = super(memmap, self).__array_wrap__(arr, context) + arr = super().__array_wrap__(arr, context) # Return a memmap if a memmap was given as the output of the # ufunc. Leave the arr class unchanged if self is not a memmap @@ -331,7 +331,7 @@ class memmap(ndarray): return arr.view(np.ndarray) def __getitem__(self, index): - res = super(memmap, self).__getitem__(index) + res = super().__getitem__(index) if type(res) is memmap and res._mmap is None: return res.view(type=ndarray) return res diff --git a/numpy/core/records.py b/numpy/core/records.py index a626a0589..0efc951a3 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -244,12 +244,12 @@ class record(nt.void): def __repr__(self): if get_printoptions()['legacy'] == '1.13': return self.__str__() - return super(record, self).__repr__() + return super().__repr__() def __str__(self): if get_printoptions()['legacy'] == '1.13': return str(self.item()) - return super(record, self).__str__() + return super().__str__() def __getattribute__(self, attr): if attr in ('setfield', 'getfield', 'dtype'): @@ -518,7 +518,7 @@ class recarray(ndarray): return self.setfield(val, *res) def __getitem__(self, indx): - obj = super(recarray, self).__getitem__(indx) + obj = super().__getitem__(indx) # copy behavior of getattr, except that here # we might also be returning a single element diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py index 2c5f1577d..8f63b5b70 100644 --- a/numpy/core/tests/test_arrayprint.py +++ b/numpy/core/tests/test_arrayprint.py @@ -45,7 +45,7 @@ class TestArrayRepr: return obj def __getitem__(self, ind): - ret = super(sub, self).__getitem__(ind) + ret = super().__getitem__(ind) return sub(ret) # test that object + subclass is OK: @@ -67,7 +67,7 @@ class TestArrayRepr: return obj def __getitem__(self, ind): - ret = super(sub, self).__getitem__(ind) + ret = super().__getitem__(ind) return sub(ret) x = sub(1) @@ -101,7 +101,7 @@ class TestArrayRepr: # gh-10663 class DuckCounter(np.ndarray): def __getitem__(self, item): - result = super(DuckCounter, self).__getitem__(item) + result = super().__getitem__(item) if not isinstance(result, DuckCounter): result = result[...].view(DuckCounter) return result diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 099293307..66b5d5516 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -1750,7 +1750,7 @@ class TestRegression: # it is designed to simulate an old API # expectation to guard against regression def squeeze(self): - return super(OldSqueeze, self).squeeze() + return super().squeeze() oldsqueeze = OldSqueeze(np.array([[1],[2],[3]])) diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 2249c866c..556856faf 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -2703,8 +2703,8 @@ class TestSpecialMethods: if out_no: info['outputs'] = out_no - results = super(A, self).__array_ufunc__(ufunc, method, - *args, **kwargs) + results = super().__array_ufunc__(ufunc, method, + *args, **kwargs) if results is NotImplemented: return NotImplemented |