Skip to content

Commit 78531d7

Browse files
authored
Merge pull request #1149 from DimitriPapadopoulos/object
MNT: No need to inherit `object` in Python 3
2 parents d95e0a3 + 9da60e5 commit 78531d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+90
-90
lines changed

doc/source/devel/biaps/biap_0002.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ sliced array, as in:
104104

105105
.. code:: python
106106
107-
class SomeImage(object):
108-
class Slicer(object):
107+
class SomeImage:
108+
class Slicer:
109109
def __init__(self, parent):
110110
self.parent = parent
111111
def __getitem__(self, slicedef):

doc/tools/apigen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
DEBUG = True
2929

3030

31-
class ApiDocWriter(object):
31+
class ApiDocWriter:
3232
""" Class for automatic detection and parsing of API docs
3333
to Sphinx-parsable reST format"""
3434

@@ -118,7 +118,7 @@ def _get_object_name(self, line):
118118
>>> docwriter = ApiDocWriter('sphinx')
119119
>>> docwriter._get_object_name(" def func(): ")
120120
'func'
121-
>>> docwriter._get_object_name(" class Klass(object): ")
121+
>>> docwriter._get_object_name(" class Klass: ")
122122
'Klass'
123123
>>> docwriter._get_object_name(" class Klass: ")
124124
'Klass'

nibabel/arraywriters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ScalingError(WriterError):
4545
pass
4646

4747

48-
class ArrayWriter(object):
48+
class ArrayWriter:
4949

5050
def __init__(self, array, out_dtype=None, **kwargs):
5151
r""" Initialize array writer

nibabel/batteryrunners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def chk_pixdims(hdr, fix=True):
108108
"""
109109

110110

111-
class BatteryRunner(object):
111+
class BatteryRunner:
112112
""" Class to run set of checks """
113113

114114
def __init__(self, checks):
@@ -174,7 +174,7 @@ def __len__(self):
174174
return len(self._checks)
175175

176176

177-
class Report(object):
177+
class Report:
178178

179179
def __init__(self,
180180
error=Exception,

nibabel/cmdline/dicomfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import logging
1919

2020

21-
class dummy_fuse(object):
21+
class dummy_fuse:
2222
"""Dummy fuse "module" so that nose does not blow during doctests"""
2323
Fuse = object
2424

nibabel/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BomberError(DataError, AttributeError):
3131
pass
3232

3333

34-
class Datasource(object):
34+
class Datasource:
3535
""" Simple class to add base path to relative path """
3636

3737
def __init__(self, base_path):
@@ -302,7 +302,7 @@ def make_datasource(pkg_def, **kwargs):
302302
return VersionedDatasource(pth)
303303

304304

305-
class Bomber(object):
305+
class Bomber:
306306
""" Class to raise an informative error when used """
307307

308308
def __init__(self, name, msg):

nibabel/deprecated.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .pkg_info import cmp_pkg_version
88

99

10-
class ModuleProxy(object):
10+
class ModuleProxy:
1111
""" Proxy for module that may not yet have been imported
1212
1313
Parameters
@@ -39,12 +39,12 @@ def __repr__(self):
3939
return f"<module proxy for {self._module_name}>"
4040

4141

42-
class FutureWarningMixin(object):
42+
class FutureWarningMixin:
4343
""" Insert FutureWarning for object creation
4444
4545
Examples
4646
--------
47-
>>> class C(object): pass
47+
>>> class C: pass
4848
>>> class D(FutureWarningMixin, C):
4949
... warn_message = "Please, don't use this class"
5050

nibabel/deprecator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _add_dep_doc(old_doc, dep_doc, setup='', cleanup=''):
8383
old_lines[next_line:] + cleanup_lines + [''])
8484

8585

86-
class Deprecator(object):
86+
class Deprecator:
8787
""" Class to make decorator marking function or method as deprecated
8888
8989
The decorated function / method will:

nibabel/dft.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __str__(self):
5858
return fmt % (self.i + 1, self.si.instance_number)
5959

6060

61-
class _Study(object):
61+
class _Study:
6262

6363
def __init__(self, d):
6464
self.uid = d['uid']
@@ -91,7 +91,7 @@ def patient_name_or_uid(self):
9191
return self.patient_name
9292

9393

94-
class _Series(object):
94+
class _Series:
9595

9696
def __init__(self, d):
9797
self.uid = d['uid']
@@ -219,7 +219,7 @@ def nifti_size(self):
219219
return 352 + 2 * len(self.storage_instances) * self.columns * self.rows
220220

221221

222-
class _StorageInstance(object):
222+
class _StorageInstance:
223223

224224
def __init__(self, d):
225225
self.uid = d['uid']

nibabel/ecat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def read_subheaders(fileobj, mlist, endianness):
511511
return subheaders
512512

513513

514-
class EcatSubHeader(object):
514+
class EcatSubHeader:
515515

516516
_subhdrdtype = subhdr_dtype
517517
_data_type_codes = data_type_codes
@@ -660,7 +660,7 @@ def data_from_fileobj(self, frame=0, orientation=None):
660660
return data
661661

662662

663-
class EcatImageArrayProxy(object):
663+
class EcatImageArrayProxy:
664664
""" Ecat implementation of array proxy protocol
665665
666666
The array proxy allows us to freeze the passed fileobj and

0 commit comments

Comments
 (0)