Do not explicitly extend object

This commit is contained in:
Nikita Karamov 2023-01-23 06:45:59 +01:00
parent 1ceeaf11e6
commit d1fd32fd5b
No known key found for this signature in database
GPG key ID: 41D6F71EE78E77CD
5 changed files with 11 additions and 11 deletions

View file

@ -421,7 +421,7 @@ sciExponent = re.compile(r"[eE]([-+]?\d+)")
unit = re.compile("(em|ex|px|pt|pc|cm|mm|in|%){1,1}$")
class Unit(object):
class Unit:
# Integer constants for units.
INVALID = -1
NONE = 0
@ -483,7 +483,7 @@ class Unit(object):
str = staticmethod(str)
class SVGLength(object):
class SVGLength:
def __init__(self, str):
try: # simple unitless and no scientific notation

View file

@ -1,4 +1,4 @@
class ScourStats(object):
class ScourStats:
__slots__ = (
'num_elements_removed',

View file

@ -50,7 +50,7 @@ from functools import partial
# Sentinel.
class _EOF(object):
class _EOF:
def __repr__(self):
return 'EOF'
@ -65,7 +65,7 @@ lexicon = [
]
class Lexer(object):
class Lexer:
""" Break SVG path data into tokens.
The SVG spec requires that tokens are greedy. This lexer relies on Python's
@ -102,7 +102,7 @@ class Lexer(object):
svg_lexer = Lexer(lexicon)
class SVGPathParser(object):
class SVGPathParser:
""" Parse SVG <path> data into a list of commands.
Each distinct command will take the form of a tuple (command, data). The

View file

@ -64,7 +64,7 @@ from six.moves import range
# Sentinel.
class _EOF(object):
class _EOF:
def __repr__(self):
return 'EOF'
@ -81,7 +81,7 @@ lexicon = [
]
class Lexer(object):
class Lexer:
""" Break SVG path data into tokens.
The SVG spec requires that tokens are greedy. This lexer relies on Python's
@ -118,7 +118,7 @@ class Lexer(object):
svg_lexer = Lexer(lexicon)
class SVGTransformationParser(object):
class SVGTransformationParser:
""" Parse SVG transform="" data into a list of commands.
Each distinct command will take the form of a tuple (type, data). The

View file

@ -2550,7 +2550,7 @@ class CommandLineUsage(unittest.TestCase):
# stdout: a string representing the combined output to 'stdout'
# stderr: a string representing the combined output to 'stderr'
def _run_scour(self):
class Result(object):
class Result:
pass
result = Result()
@ -2578,7 +2578,7 @@ class CommandLineUsage(unittest.TestCase):
# TODO: can we create file objects that behave *exactly* like the original?
# this is a mess since we have to ensure compatibility across Python 2 and 3 and it seems impossible
# to replicate all the details of 'stdin', 'stdout' and 'stderr'
class InOutBuffer(six.StringIO, object):
class InOutBuffer(six.StringIO):
def write(self, string):
try:
return super(InOutBuffer, self).write(string)