Skip to content

Commit fb20412

Browse files
committed
CLN: remove unneeded inheritance from base object
1 parent 68b1da7 commit fb20412

File tree

302 files changed

+592
-592
lines changed

Some content is hidden

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

302 files changed

+592
-592
lines changed

doc/source/development/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ Transitioning to ``pytest``
773773

774774
.. code-block:: python
775775
776-
class TestReallyCoolFeature(object):
776+
class TestReallyCoolFeature:
777777
pass
778778
779779
Going forward, we are moving to a more *functional* style using the `pytest <http://docs.pytest.org/en/latest/>`__ framework, which offers a richer testing

doc/source/development/extending.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ decorate a class, providing the name of attribute to add. The class's
2626
.. code-block:: python
2727
2828
@pd.api.extensions.register_dataframe_accessor("geo")
29-
class GeoAccessor(object):
29+
class GeoAccessor:
3030
def __init__(self, pandas_obj):
3131
self._validate(pandas_obj)
3232
self._obj = pandas_obj

pandas/_config/config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def get_default_val(pat):
177177
return _get_registered_option(key).defval
178178

179179

180-
class DictWrapper(object):
180+
class DictWrapper:
181181
""" provide attribute-style access to a nested dict"""
182182

183183
def __init__(self, d, prefix=""):
@@ -222,7 +222,7 @@ def __dir__(self):
222222
# of options, and option descriptions.
223223

224224

225-
class CallableDynamicDoc(object):
225+
class CallableDynamicDoc:
226226

227227
def __init__(self, func, doc_tmpl):
228228
self.__doc_tmpl__ = doc_tmpl
@@ -379,7 +379,7 @@ def __doc__(self):
379379
# Functions for use by pandas developers, in addition to User - api
380380

381381

382-
class option_context(object):
382+
class option_context:
383383
"""
384384
Context manager to temporarily set options in the `with` statement context.
385385

pandas/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_keywords():
2626
return keywords
2727

2828

29-
class VersioneerConfig(object):
29+
class VersioneerConfig:
3030
pass
3131

3232

pandas/compat/numpy/function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
validate_args, validate_args_and_kwargs, validate_kwargs)
2828

2929

30-
class CompatValidator(object):
30+
class CompatValidator:
3131

3232
def __init__(self, defaults, fname=None, method=None,
3333
max_fname_arg_count=None):

pandas/core/accessor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pandas.util._decorators import Appender
1111

1212

13-
class DirNamesMixin(object):
13+
class DirNamesMixin:
1414
_accessors = frozenset()
1515
_deprecations = frozenset(
1616
['asobject', 'base', 'data', 'flags', 'itemsize', 'strides'])
@@ -44,7 +44,7 @@ def __dir__(self):
4444
return sorted(rv)
4545

4646

47-
class PandasDelegate(object):
47+
class PandasDelegate:
4848
"""
4949
An abstract base class for delegating methods/properties.
5050
"""
@@ -151,7 +151,7 @@ def add_delegate_accessors(cls):
151151
# 1. We don't need to catch and re-raise AttributeErrors as RuntimeErrors
152152
# 2. We use a UserWarning instead of a custom Warning
153153

154-
class CachedAccessor(object):
154+
class CachedAccessor:
155155
"""
156156
Custom property-like object (descriptor) for caching accessors.
157157
@@ -235,7 +235,7 @@ def __init__(self, pandas_object): # noqa: E999
235235
import pandas as pd
236236
237237
@pd.api.extensions.register_dataframe_accessor("geo")
238-
class GeoAccessor(object):
238+
class GeoAccessor:
239239
def __init__(self, pandas_obj):
240240
self._obj = pandas_obj
241241

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def _get_score(at):
10471047
# select n #
10481048
# --------------- #
10491049

1050-
class SelectN(object):
1050+
class SelectN:
10511051

10521052
def __init__(self, obj, n, keep):
10531053
self.obj = obj

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949

5050
# Deprecation: xref gh-16747
51-
class TimeGrouper(object):
51+
class TimeGrouper:
5252

5353
def __new__(cls, *args, **kwargs):
5454
from pandas.core.resample import TimeGrouper

pandas/core/apply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def frame_apply(obj, func, axis=0, broadcast=None,
3131
args=args, kwds=kwds)
3232

3333

34-
class FrameApply(object):
34+
class FrameApply:
3535

3636
def __init__(self, obj, func, broadcast, raw, reduce, result_type,
3737
ignore_failures, args, kwds):

pandas/core/arrays/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
_extension_array_shared_docs = dict()
3030

3131

32-
class ExtensionArray(object):
32+
class ExtensionArray:
3333
"""
3434
Abstract base class for custom 1-D array types.
3535
@@ -964,7 +964,7 @@ def _reduce(self, name, skipna=True, **kwargs):
964964
name=name, dtype=self.dtype))
965965

966966

967-
class ExtensionOpsMixin(object):
967+
class ExtensionOpsMixin:
968968
"""
969969
A base class for linking the operators to their dunder names.
970970

pandas/core/arrays/datetimelike.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from .base import ExtensionArray, ExtensionOpsMixin
4040

4141

42-
class AttributesMixin(object):
42+
class AttributesMixin:
4343

4444
@property
4545
def _attributes(self):
@@ -135,7 +135,7 @@ def _check_compatible_with(
135135
raise AbstractMethodError(self)
136136

137137

138-
class DatelikeOps(object):
138+
class DatelikeOps:
139139
"""
140140
Common ops for DatetimeIndex/PeriodIndex, but not TimedeltaIndex.
141141
"""
@@ -181,7 +181,7 @@ def strftime(self, date_format):
181181
return Index(self._format_native_types(date_format=date_format))
182182

183183

184-
class TimelikeOps(object):
184+
class TimelikeOps:
185185
"""
186186
Common ops for TimedeltaIndex/DatetimeIndex, but not PeriodIndex.
187187
"""

pandas/core/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
unique='IndexOpsMixin', duplicated='IndexOpsMixin')
3333

3434

35-
class StringMixin(object):
35+
class StringMixin:
3636
"""
3737
Implements string methods so long as object defines a `__unicode__` method.
3838
"""
@@ -110,7 +110,7 @@ def __sizeof__(self):
110110
return super(PandasObject, self).__sizeof__()
111111

112112

113-
class NoNewAttributesMixin(object):
113+
class NoNewAttributesMixin:
114114
"""Mixin which prevents adding new attributes.
115115
116116
Prevents additional attributes via xxx.attribute = "something" after a
@@ -153,7 +153,7 @@ class SpecificationError(GroupByError):
153153
pass
154154

155155

156-
class SelectionMixin(object):
156+
class SelectionMixin:
157157
"""
158158
mixin implementing the selection & aggregation interface on a group-like
159159
object sub-classes need to define: obj, exclusions
@@ -645,7 +645,7 @@ def _is_builtin_func(self, arg):
645645
return self._builtin_table.get(arg, arg)
646646

647647

648-
class IndexOpsMixin(object):
648+
class IndexOpsMixin:
649649
""" common ops mixin to support a unified interface / docs for Series /
650650
Index
651651
"""

pandas/core/computation/engines.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _check_ne_builtin_clash(expr):
3535
.format(expr=expr, s=s))
3636

3737

38-
class AbstractEngine(object):
38+
class AbstractEngine:
3939

4040
"""Object serving as a base class for all engines."""
4141

pandas/core/computation/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ def __unicode__(self):
541541
return pprint_thing('{0}({1})'.format(self.op, ','.join(operands)))
542542

543543

544-
class FuncNode(object):
544+
class FuncNode:
545545
def __init__(self, name):
546546
from pandas.core.computation.check import (_NUMEXPR_INSTALLED,
547547
_NUMEXPR_VERSION)

pandas/core/computation/pytables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def evaluate(self):
572572
return self.condition, self.filter
573573

574574

575-
class TermValue(object):
575+
class TermValue:
576576

577577
""" hold a term value the we use to construct a condition/filter """
578578

pandas/core/dtypes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
99

1010

11-
class _DtypeOpsMixin(object):
11+
class _DtypeOpsMixin:
1212
# Not all of pandas' extension dtypes are compatibile with
1313
# the new ExtensionArray interface. This means PandasExtensionDtype
1414
# can't subclass ExtensionDtype yet, as is_extension_array_dtype would

pandas/core/dtypes/dtypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def register_extension_dtype(cls):
3939
return cls
4040

4141

42-
class Registry(object):
42+
class Registry:
4343
"""
4444
Registry for dtype inference
4545

pandas/core/groupby/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pandas.core.dtypes.common import is_list_like, is_scalar
1212

1313

14-
class GroupByMixin(object):
14+
class GroupByMixin:
1515
"""
1616
Provide the groupby facilities to the mixed object.
1717
"""

pandas/core/groupby/grouper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pandas.io.formats.printing import pprint_thing
2626

2727

28-
class Grouper(object):
28+
class Grouper:
2929
"""
3030
A Grouper allows the user to specify a groupby instruction for a target
3131
object
@@ -204,7 +204,7 @@ def __repr__(self):
204204
return "{}({})".format(cls_name, attrs)
205205

206206

207-
class Grouping(object):
207+
class Grouping:
208208

209209
"""
210210
Holds the grouping information for a single key

pandas/core/groupby/ops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def generate_bins_generic(values, binner, closed):
8787
return bins
8888

8989

90-
class BaseGrouper(object):
90+
class BaseGrouper:
9191
"""
9292
This is an internal Grouper class, which actually holds
9393
the generated groups
@@ -808,7 +808,7 @@ def _is_indexed_like(obj, axes):
808808
# Splitting / application
809809

810810

811-
class DataSplitter(object):
811+
class DataSplitter:
812812

813813
def __init__(self, data, labels, ngroups, axis=0):
814814
self.data = data

pandas/core/indexing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_indexers_list():
3535

3636

3737
# the public IndexSlicerMaker
38-
class _IndexSlice(object):
38+
class _IndexSlice:
3939
"""
4040
Create an object to more easily perform multi-index slicing
4141

pandas/core/internals/blocks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ def _replace_coerce(self, to_replace, value, inplace=True, regex=False,
15191519
return self
15201520

15211521

1522-
class NonConsolidatableMixIn(object):
1522+
class NonConsolidatableMixIn:
15231523
""" hold methods for the nonconsolidatable blocks """
15241524
_can_consolidate = False
15251525
_verify_integrity = False
@@ -2033,7 +2033,7 @@ def should_store(self, value):
20332033
return is_integer_dtype(value) and value.dtype == self.dtype
20342034

20352035

2036-
class DatetimeLikeBlockMixin(object):
2036+
class DatetimeLikeBlockMixin:
20372037
"""Mixin class for DatetimeBlock, DatetimeTZBlock, and TimedeltaBlock."""
20382038

20392039
@property

pandas/core/internals/concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def get_mgr_concatenation_plan(mgr, indexers):
9999
return plan
100100

101101

102-
class JoinUnit(object):
102+
class JoinUnit:
103103

104104
def __init__(self, block, shape, indexers=None):
105105
# Passing shape explicitly is required for cases when block is None.

pandas/core/nanops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def set_use_bottleneck(v=True):
5454
set_use_bottleneck(get_option('compute.use_bottleneck'))
5555

5656

57-
class disallow(object):
57+
class disallow:
5858

5959
def __init__(self, *dtypes):
6060
super(disallow, self).__init__()
@@ -86,7 +86,7 @@ def _f(*args, **kwargs):
8686
return _f
8787

8888

89-
class bottleneck_switch(object):
89+
class bottleneck_switch:
9090

9191
def __init__(self, **kwargs):
9292
self.kwargs = kwargs

pandas/core/reshape/concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False,
229229
return op.get_result()
230230

231231

232-
class _Concatenator(object):
232+
class _Concatenator:
233233
"""
234234
Orchestrates a concatenation operation for BlockManagers
235235
"""

pandas/core/reshape/merge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def merge_asof(left, right, on=None,
469469

470470
# TODO: transformations??
471471
# TODO: only copy DataFrames when modification necessary
472-
class _MergeOperation(object):
472+
class _MergeOperation:
473473
"""
474474
Perform a database (SQL) merge operation between two DataFrame objects
475475
using either columns as keys or their row indexes

pandas/core/reshape/reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
get_group_index)
2525

2626

27-
class _Unstacker(object):
27+
class _Unstacker:
2828
"""
2929
Helper class to unstack data / pivot with multi-level index
3030

pandas/core/sorting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def nargsort(items, kind='quicksort', ascending=True, na_position='last'):
283283
return indexer
284284

285285

286-
class _KeyMapper(object):
286+
class _KeyMapper:
287287

288288
"""
289289
Ease my suffering. Map compressed group id -> key tuple

pandas/io/clipboard/clipboards.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def paste_klipper():
124124

125125

126126
def init_no_clipboard():
127-
class ClipboardUnavailable(object):
127+
class ClipboardUnavailable:
128128

129129
def __call__(self, *args, **kwargs):
130130
raise PyperclipException(EXCEPT_MSG)

0 commit comments

Comments
 (0)