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 /numpy/f2py/tests | |
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 'numpy/f2py/tests')
-rw-r--r-- | numpy/f2py/tests/test_array_from_pyobj.py | 10 | ||||
-rw-r--r-- | numpy/f2py/tests/test_callback.py | 2 | ||||
-rw-r--r-- | numpy/f2py/tests/util.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/numpy/f2py/tests/test_array_from_pyobj.py b/numpy/f2py/tests/test_array_from_pyobj.py index c5757dba1..b719f2495 100644 --- a/numpy/f2py/tests/test_array_from_pyobj.py +++ b/numpy/f2py/tests/test_array_from_pyobj.py @@ -55,7 +55,7 @@ def flags2names(flags): return info -class Intent(object): +class Intent: def __init__(self, intent_list=[]): self.intent_list = intent_list[:] @@ -129,7 +129,7 @@ if ((intp().dtype.itemsize != 4 or clongdouble().dtype.alignment <= 8) and _cast_dict['CDOUBLE'] = _cast_dict['DOUBLE'] + ['CFLOAT', 'CDOUBLE'] -class Type(object): +class Type: _type_cache = {} def __new__(cls, name): @@ -190,7 +190,7 @@ class Type(object): return types -class Array(object): +class Array: def __init__(self, typ, dims, intent, obj): self.type = typ @@ -291,7 +291,7 @@ class Array(object): return obj_attr[0] == self.arr_attr[0] -class TestIntent(object): +class TestIntent: def test_in_out(self): assert_equal(str(intent.in_.out), 'intent(in,out)') @@ -302,7 +302,7 @@ class TestIntent(object): assert_(not intent.in_.is_intent('c')) -class TestSharedMemory(object): +class TestSharedMemory: num2seq = [1, 2] num23seq = [[1, 2, 3], [4, 5, 6]] diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py index e4e61f450..7629df605 100644 --- a/numpy/f2py/tests/test_callback.py +++ b/numpy/f2py/tests/test_callback.py @@ -116,7 +116,7 @@ cf2py intent(out) a r = t(self.module.func0._cpointer) assert_(r == 11, repr(r)) - class A(object): + class A: def __call__(self): return 7 diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index c4fcea8d1..c430a6608 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -313,7 +313,7 @@ def build_module_distutils(source_files, config_code, module_name, **kw): # -class F2PyTest(object): +class F2PyTest: code = None sources = None options = [] |