Skip to content

Commit 64104ec

Browse files
topper-123gfyoung
authored andcommitted
Remove inheritance from object in pyx-files (#26217)
xref gh-25725, gh-26128 (continuation)
1 parent 65466f0 commit 64104ec

17 files changed

+20
-20
lines changed

asv_bench/benchmarks/index_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def time_get_loc(self):
181181
self.ind.get_loc(0)
182182

183183

184-
class IntervalIndexMethod(object):
184+
class IntervalIndexMethod:
185185
# GH 24813
186186
params = [10**3, 10**5]
187187

ci/code_checks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
141141
RET=$(($RET + $?)) ; echo $MSG "DONE"
142142

143143
MSG='Check for python2 new-style classes' ; echo $MSG
144-
invgrep -R --include="*.py" -E "class\s\S*\(object\):" pandas scripts
144+
invgrep -R --include="*.py" --include="*.pyx" -E "class\s\S*\(object\):" pandas scripts
145145
RET=$(($RET + $?)) ; echo $MSG "DONE"
146146

147147
MSG='Check for backticks incorrectly rendering because of missing spaces' ; echo $MSG

pandas/_libs/algos.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cdef inline bint are_diff(object left, object right):
5050
return left != right
5151

5252

53-
class Infinity(object):
53+
class Infinity:
5454
""" provide a positive Infinity comparison method for ranking """
5555

5656
__lt__ = lambda self, other: False
@@ -62,7 +62,7 @@ class Infinity(object):
6262
__ge__ = lambda self, other: not missing.checknull(other)
6363

6464

65-
class NegInfinity(object):
65+
class NegInfinity:
6666
""" provide a negative Infinity comparison method for ranking """
6767

6868
__lt__ = lambda self, other: (not isinstance(other, NegInfinity) and

pandas/_libs/interval.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ from pandas._libs.tslibs.timezones cimport tz_compare
3030
_VALID_CLOSED = frozenset(['left', 'right', 'both', 'neither'])
3131

3232

33-
cdef class IntervalMixin(object):
33+
cdef class IntervalMixin:
3434

3535
@property
3636
def closed_left(self):

pandas/_libs/lib.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ except AttributeError:
935935
pass
936936

937937

938-
cdef class Seen(object):
938+
cdef class Seen:
939939
"""
940940
Class for keeping track of the types of elements
941941
encountered when trying to perform type conversions.

pandas/_libs/properties.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from cpython cimport (
66
PyDict_Contains, PyDict_GetItem, PyDict_SetItem)
77

88

9-
cdef class CachedProperty(object):
9+
cdef class CachedProperty:
1010

1111
cdef readonly:
1212
object func, name, __doc__
@@ -44,7 +44,7 @@ cdef class CachedProperty(object):
4444
cache_readonly = CachedProperty
4545

4646

47-
cdef class AxisProperty(object):
47+
cdef class AxisProperty:
4848

4949
cdef readonly:
5050
Py_ssize_t axis

pandas/_libs/sparse.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ cdef class BlockIndex(SparseIndex):
614614
pass
615615

616616

617-
cdef class BlockMerge(object):
617+
cdef class BlockMerge:
618618
"""
619619
Object-oriented approach makes sharing state between recursive functions a
620620
lot easier and reduces code duplication

pandas/_libs/tslibs/frequencies.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ INVALID_FREQ_ERR_MSG = "Invalid frequency: {0}"
2222
# Period codes
2323

2424

25-
class FreqGroup(object):
25+
class FreqGroup:
2626
FR_ANN = 1000
2727
FR_QTR = 2000
2828
FR_MTH = 3000

pandas/_libs/tslibs/offsets.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class ApplyTypeError(TypeError):
312312
# ---------------------------------------------------------------------
313313
# Base Classes
314314

315-
class _BaseOffset(object):
315+
class _BaseOffset:
316316
"""
317317
Base class for DateOffset methods that are not overridden by subclasses
318318
and will (after pickle errors are resolved) go into a cdef class.
@@ -533,7 +533,7 @@ class BaseOffset(_BaseOffset):
533533
return -self + other
534534

535535

536-
class _Tick(object):
536+
class _Tick:
537537
"""
538538
dummy class to mix into tseries.offsets.Tick so that in tslibs.period we
539539
can do isinstance checks on _Tick and avoid importing tseries.offsets

pandas/_libs/tslibs/parsing.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ def try_parse_datetime_components(object[:] years,
660660
# Thus, we port the class over so that both issues are resolved.
661661
#
662662
# Copyright (c) 2017 - dateutil contributors
663-
class _timelex(object):
663+
class _timelex:
664664
def __init__(self, instream):
665665
if getattr(instream, 'decode', None) is not None:
666666
instream = instream.decode()

pandas/_libs/tslibs/period.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ class IncompatibleFrequency(ValueError):
15571557
pass
15581558

15591559

1560-
cdef class _Period(object):
1560+
cdef class _Period:
15611561

15621562
cdef readonly:
15631563
int64_t ordinal

pandas/_libs/tslibs/resolution.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def get_freq_group(freq):
133133
return (freq // 1000) * 1000
134134

135135

136-
class Resolution(object):
136+
class Resolution:
137137

138138
# Note: cython won't allow us to reference the cdef versions at the
139139
# module level

pandas/_libs/tslibs/strptime.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def _getlang():
363363
return locale.getlocale(locale.LC_TIME)
364364

365365

366-
class LocaleTime(object):
366+
class LocaleTime:
367367
"""Stores and handles locale-specific information related to time.
368368
369369
ATTRIBUTES:

pandas/_libs/tslibs/timestamps.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cdef inline object create_timestamp_from_ts(int64_t value,
5757
return ts_base
5858

5959

60-
class RoundTo(object):
60+
class RoundTo:
6161
"""
6262
enumeration defining the available rounding modes
6363

pandas/io/msgpack/_packer.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cdef extern from "../../src/msgpack/pack.h":
4444
cdef int DEFAULT_RECURSE_LIMIT=511
4545

4646

47-
cdef class Packer(object):
47+
cdef class Packer:
4848
"""
4949
MessagePack Packer
5050

pandas/io/msgpack/_unpacker.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def unpack(object stream, object object_hook=None, object list_hook=None,
173173
encoding=encoding, unicode_errors=unicode_errors)
174174

175175

176-
cdef class Unpacker(object):
176+
cdef class Unpacker:
177177
"""Streaming unpacker.
178178
179179
arguments:

pandas/io/sas/sas.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ cdef:
211211
int subheader_pointers_offset = const.subheader_pointers_offset
212212

213213

214-
cdef class Parser(object):
214+
cdef class Parser:
215215

216216
cdef:
217217
int column_count

0 commit comments

Comments
 (0)