Skip to content

Commit bfd3d92

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

File tree

303 files changed

+589
-593
lines changed

Some content is hidden

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

303 files changed

+589
-593
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
140140
invgrep -R --include="*.py" --include="*.pyx" -E "(DEPRECATED|DEPRECATE|Deprecated)(:|,|\.)" pandas
141141
RET=$(($RET + $?)) ; echo $MSG "DONE"
142142

143-
MSG='Check for old-style classes' ; echo $MSG
144-
invgrep -R --include="*.py" -E "class\s\S*[^)]:" pandas scripts
145-
RET=$(($RET + $?)) ; echo $MSG "DONE"
146-
147143
MSG='Check for backticks incorrectly rendering because of missing spaces' ; echo $MSG
148144
invgrep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/
149145
RET=$(($RET + $?)) ; echo $MSG "DONE"

doc/source/development/contributing.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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):

0 commit comments

Comments
 (0)