Skip to content

Commit 3621823

Browse files
Apply ruff/pyupgrade rule UP004
UP004 Class inherits from `object`
1 parent 7020b2d commit 3621823

22 files changed

+40
-40
lines changed

demo/_curses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class error(Exception):
219219
pass
220220

221221

222-
class Window(object):
222+
class Window:
223223
def __init__(self, window):
224224
self._win = window
225225

demo/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def verify(self, source='', **kwargs):
3535
return lib
3636

3737

38-
class _PyExport(object):
38+
class _PyExport:
3939
def __init__(self, tp, func):
4040
self.tp = tp
4141
self.func = func

demo/pyobj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def discard(p):
2424
freelist = p
2525
return x
2626

27-
class Ref(object):
27+
class Ref:
2828
"""For use in 'with Ref(x) as ob': open an object descriptor
2929
and returns it in 'ob', and close it automatically when the
3030
'with' statement finishes."""

src/c/test_c.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _capture_unraisable_hook(ur_args):
7575
mandatory_u_prefix = 'u'
7676
bytechr = chr
7777
bitem2bchr = lambda x: x
78-
class U(object):
78+
class U:
7979
def __add__(self, other):
8080
return eval('u'+repr(other).replace(r'\\u', r'\u')
8181
.replace(r'\\U', r'\U'))
@@ -3322,7 +3322,7 @@ def test_new_handle_cycle():
33223322
import gc
33233323
import _weakref
33243324
BVoidP = new_pointer_type(new_void_type())
3325-
class A(object):
3325+
class A:
33263326
pass
33273327
o = A()
33283328
o.cycle = newp_handle(BVoidP, o)
@@ -3849,7 +3849,7 @@ def check(methods, expected, expected_for_memoryview=None):
38493849
return
38503850
if expected_for_memoryview is not None:
38513851
expected = expected_for_memoryview
3852-
class X(object):
3852+
class X:
38533853
pass
38543854
_testbuff(X, methods)
38553855
bufobj = X()

src/cffi/api.py

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

2121

2222

23-
class FFI(object):
23+
class FFI:
2424
r'''
2525
The main top-level class that you instantiate once, or once per module.
2626
@@ -909,7 +909,7 @@ def make_accessor(name):
909909
raise AttributeError(name)
910910
accessors[name](name)
911911
#
912-
class FFILibrary(object):
912+
class FFILibrary:
913913
def __getattr__(self, name):
914914
make_accessor(name)
915915
return getattr(self, name)

src/cffi/backend_ctypes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class CTypesType(type):
1313
pass
1414

15-
class CTypesData(object):
15+
class CTypesData:
1616
__metaclass__ = CTypesType
1717
__slots__ = ['__weakref__']
1818
__name__ = '<cdata>'
@@ -270,7 +270,7 @@ def __repr__(self, c_name=None):
270270
return CTypesData.__repr__(self, c_name or self._get_c_name(' &'))
271271

272272

273-
class CTypesBackend(object):
273+
class CTypesBackend:
274274

275275
PRIMITIVE_TYPES = {
276276
'char': ctypes.c_char,
@@ -1094,7 +1094,7 @@ def rawaddressof(self, BTypePtr, cdata, offset=None):
10941094
return BTypePtr._from_ctypes(ptr)
10951095

10961096

1097-
class CTypesLibrary(object):
1097+
class CTypesLibrary:
10981098

10991099
def __init__(self, backend, cdll):
11001100
self.backend = backend

src/cffi/cffi_opcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .error import VerificationError
22

3-
class CffiOp(object):
3+
class CffiOp:
44
def __init__(self, op, arg):
55
self.op = op
66
self.arg = arg

src/cffi/cparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def _common_type_names(csource):
292292
return words_used
293293

294294

295-
class Parser(object):
295+
class Parser:
296296

297297
def __init__(self):
298298
self._declarations = {}

src/cffi/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def qualify(quals, replace_with):
2222
return replace_with
2323

2424

25-
class BaseTypeByIdentity(object):
25+
class BaseTypeByIdentity:
2626
is_array_type = False
2727
is_raw_function = False
2828

src/cffi/vengine_cpy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from . import _imp_emulation as imp
88

99

10-
class VCPythonEngine(object):
10+
class VCPythonEngine:
1111
_class_key = 'x'
1212
_gen_python_module = True
1313

@@ -183,7 +183,7 @@ def load_library(self, flags=None):
183183
# it will invoke the chained list of functions that will really
184184
# build (notably) the constant objects, as <cdata> if they are
185185
# pointers, and store them as attributes on the 'library' object.
186-
class FFILibrary(object):
186+
class FFILibrary:
187187
_cffi_python_module = module
188188
_cffi_ffi = self.ffi
189189
_cffi_dir = []

0 commit comments

Comments
 (0)