Skip to content

Commit edced8e

Browse files
In Python 3, all classes implicitly inherit from object (#886)
No need to inherit explictly.
1 parent 862a44c commit edced8e

9 files changed

+24
-24
lines changed

zarr/convenience.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def tree(grp, expand=False, level=None):
428428
return TreeViewer(grp, expand=expand, level=level)
429429

430430

431-
class _LogWriter(object):
431+
class _LogWriter:
432432

433433
def __init__(self, log):
434434
self.log_func = None

zarr/indexing.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def normalize_integer_selection(dim_sel, dim_len):
132132
"""
133133

134134

135-
class IntDimIndexer(object):
135+
class IntDimIndexer:
136136

137137
def __init__(self, dim_sel, dim_len, dim_chunk_len):
138138

@@ -157,7 +157,7 @@ def ceildiv(a, b):
157157
return math.ceil(a / b)
158158

159159

160-
class SliceDimIndexer(object):
160+
class SliceDimIndexer:
161161

162162
def __init__(self, dim_sel, dim_len, dim_chunk_len):
163163

@@ -320,7 +320,7 @@ def is_basic_selection(selection):
320320

321321

322322
# noinspection PyProtectedMember
323-
class BasicIndexer(object):
323+
class BasicIndexer:
324324

325325
def __init__(self, selection, array):
326326

@@ -361,7 +361,7 @@ def __iter__(self):
361361
yield ChunkProjection(chunk_coords, chunk_selection, out_selection)
362362

363363

364-
class BoolArrayDimIndexer(object):
364+
class BoolArrayDimIndexer:
365365

366366
def __init__(self, dim_sel, dim_len, dim_chunk_len):
367367

@@ -451,7 +451,7 @@ def boundscheck_indices(x, dim_len):
451451
raise BoundsCheckError(dim_len)
452452

453453

454-
class IntArrayDimIndexer(object):
454+
class IntArrayDimIndexer:
455455
"""Integer array selection against a single dimension."""
456456

457457
def __init__(self, dim_sel, dim_len, dim_chunk_len, wraparound=True, boundscheck=True,
@@ -579,7 +579,7 @@ def oindex_set(a, selection, value):
579579

580580

581581
# noinspection PyProtectedMember
582-
class OrthogonalIndexer(object):
582+
class OrthogonalIndexer:
583583

584584
def __init__(self, selection, array):
585585

@@ -649,7 +649,7 @@ def __iter__(self):
649649
yield ChunkProjection(chunk_coords, chunk_selection, out_selection)
650650

651651

652-
class OIndex(object):
652+
class OIndex:
653653

654654
def __init__(self, array):
655655
self.array = array
@@ -686,7 +686,7 @@ def is_mask_selection(selection, array):
686686

687687

688688
# noinspection PyProtectedMember
689-
class CoordinateIndexer(object):
689+
class CoordinateIndexer:
690690

691691
def __init__(self, selection, array):
692692

@@ -805,7 +805,7 @@ def __init__(self, selection, array):
805805
super().__init__(selection, array)
806806

807807

808-
class VIndex(object):
808+
class VIndex:
809809

810810
def __init__(self, array):
811811
self.array = array
@@ -905,7 +905,7 @@ def make_slice_selection(selection):
905905
return ls
906906

907907

908-
class PartialChunkIterator(object):
908+
class PartialChunkIterator:
909909
"""Iterator to retrieve the specific coordinates of requested data
910910
from within a compressed chunk.
911911

zarr/sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import fasteners
66

77

8-
class ThreadSynchronizer(object):
8+
class ThreadSynchronizer:
99
"""Provides synchronization using thread locks."""
1010

1111
def __init__(self):
@@ -24,7 +24,7 @@ def __setstate__(self, *args):
2424
self.__init__()
2525

2626

27-
class ProcessSynchronizer(object):
27+
class ProcessSynchronizer:
2828
"""Provides synchronization using file locks via the
2929
`fasteners <http://fasteners.readthedocs.io/en/latest/api/process_lock.html>`_
3030
package.

zarr/tests/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ def test_structured_array_contain_object(self):
24232423

24242424

24252425
# custom store, does not support getsize()
2426-
class CustomMapping(object):
2426+
class CustomMapping:
24272427

24282428
def __init__(self):
24292429
self.inner = KVStore(dict())

zarr/tests/test_creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
# something bcolz-like
23-
class MockBcolzArray(object):
23+
class MockBcolzArray:
2424

2525
def __init__(self, data, chunklen):
2626
self.data = data
@@ -34,7 +34,7 @@ def __getitem__(self, item):
3434

3535

3636
# something h5py-like
37-
class MockH5pyDataset(object):
37+
class MockH5pyDataset:
3838

3939
def __init__(self, data, chunks):
4040
self.data = data

zarr/tests/test_hierarchy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_create_group(self):
128128
assert '/a/b/c' == g5.name
129129

130130
# test non-str keys
131-
class Foo(object):
131+
class Foo:
132132

133133
def __init__(self, s):
134134
self.s = s

zarr/tests/test_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_deprecated_listdir_nosotre():
9494
listdir(store)
9595

9696

97-
class StoreTests(object):
97+
class StoreTests:
9898
"""Abstract store tests."""
9999

100100
def create_store(self, **kwargs): # pragma: no cover

zarr/tests/test_sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _set_arange(arg):
5757
return i
5858

5959

60-
class MixinArraySyncTests(object):
60+
class MixinArraySyncTests:
6161

6262
def test_parallel_setitem(self):
6363
n = 100
@@ -197,7 +197,7 @@ def _require_group(arg):
197197
return h.name
198198

199199

200-
class MixinGroupSyncTests(object):
200+
class MixinGroupSyncTests:
201201

202202
def test_parallel_create_group(self):
203203

zarr/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def info_html_report(items) -> str:
370370
return report
371371

372372

373-
class InfoReporter(object):
373+
class InfoReporter:
374374

375375
def __init__(self, obj):
376376
self.obj = obj
@@ -384,7 +384,7 @@ def _repr_html_(self):
384384
return info_html_report(items)
385385

386386

387-
class TreeNode(object):
387+
class TreeNode:
388388

389389
def __init__(self, obj, depth=0, level=None):
390390
self.obj = obj
@@ -468,7 +468,7 @@ def tree_widget(group, expand, level):
468468
return result
469469

470470

471-
class TreeViewer(object):
471+
class TreeViewer:
472472

473473
def __init__(self, group, expand=False, level=None):
474474

@@ -541,7 +541,7 @@ def is_valid_python_name(name):
541541
return name.isidentifier() and not iskeyword(name)
542542

543543

544-
class NoLock(object):
544+
class NoLock:
545545
"""A lock that doesn't lock."""
546546

547547
def __enter__(self):

0 commit comments

Comments
 (0)