Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: Remove object parent class, only needed in py2 #1069

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions asv/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def _repr_no_address(obj):
return result


class Benchmark(object):
class Benchmark:
"""
Represents a single benchmark.
"""
Expand Down Expand Up @@ -737,7 +737,7 @@ def too_slow(num_samples):
return samples, number


class _SeparateProcessTimer(object):
class _SeparateProcessTimer:
subprocess_tmpl = textwrap.dedent('''
from __future__ import print_function
from timeit import timeit, default_timer as timer
Expand Down Expand Up @@ -862,7 +862,7 @@ def run(self, *param):
]


class SpecificImporter(object):
class SpecificImporter:
"""
Module importer that only allows loading a given module from the
given path.
Expand Down
2 changes: 1 addition & 1 deletion asv/build_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import util


class BuildCache(object):
class BuildCache:
"""
Build cache

Expand Down
2 changes: 1 addition & 1 deletion asv/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
]


class Command(object):
class Command:
@classmethod
def setup_arguments(cls, subparsers):
# TODO: Document me
Expand Down
2 changes: 1 addition & 1 deletion asv/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def truncate_left(s, l):
return s


class Log(object):
class Log:
def __init__(self):
self._indent = 1
self._total = 0
Expand Down
2 changes: 1 addition & 1 deletion asv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class EnvironmentUnavailable(BaseException):
pass


class Environment(object):
class Environment:
"""
Manage a single environment -- a combination of a particular
version of Python and a set of dependencies for the benchmarked
Expand Down
16 changes: 8 additions & 8 deletions asv/extern/asizeof.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ def _len_unicode(obj):
_new_style = '' # no marker


class _Claskey(object):
class _Claskey:
'''Wrapper for class objects.
'''
__slots__ = ('_obj', '_sty')
Expand Down Expand Up @@ -1053,7 +1053,7 @@ def _claskey(obj, style):
_Types_ClassType = Types.ClassType
_Types_InstanceType = Types.InstanceType

class _Instkey(object):
class _Instkey:
'''Wrapper for old-style class (instances).
'''
__slots__ = ('_obj',)
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def _objkey(obj): # PYCHOK expected
return k


class _NamedRef(object):
class _NamedRef:
'''Store referred object along
with the name of the referent.
'''
Expand Down Expand Up @@ -1151,7 +1151,7 @@ def __init__(self, name, ref):
_Not_vari = '' # non-variable item size


class _Typedef(object):
class _Typedef:
'''Type definition class.
'''
__slots__ = {
Expand Down Expand Up @@ -1736,7 +1736,7 @@ def _typedef(obj, derive=False, frames=False, infer=False): # MCCABE 25
return v


class _Prof(object):
class _Prof:
'''Internal type profile class.
'''
high = 0 # largest size
Expand Down Expand Up @@ -1789,7 +1789,7 @@ def update(self, obj, size):
self.objref, self.weak = obj, False


class _Rank(object):
class _Rank:
'''Internal largest object class.
'''
__slots__ = {
Expand Down Expand Up @@ -1841,7 +1841,7 @@ def again(self, key):

# Public classes

class Asized(object):
class Asized:
'''Stores the results of an **asized** object in the following
4 attributes:

Expand Down Expand Up @@ -1900,7 +1900,7 @@ def get(self, name, dflt=None):
return dflt


class Asizer(object):
class Asizer:
'''Sizer state and options to accumulate sizes.
'''
_above_ = 1024 # rank only objs of 1K+ size
Expand Down
2 changes: 1 addition & 1 deletion asv/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
XML_NS = "{http://www.w3.org/XML/1998/namespace}"


class FeedEntry(object):
class FeedEntry:
"""
Atom feed entry.

Expand Down
4 changes: 2 additions & 2 deletions asv/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
RESAMPLED_POINTS = (3840 / 5 / 2)


class GraphSet(object):
class GraphSet:
"""Manage multiple `Graph`"""

def __init__(self):
Expand Down Expand Up @@ -78,7 +78,7 @@ def __len__(self):
return len(self._graphs)


class Graph(object):
class Graph:
"""
Manages a single "line" in the resulting plots for the front end.

Expand Down
4 changes: 2 additions & 2 deletions asv/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _get_unique_machine_name():
return node


class MachineCollection(object):
class MachineCollection:
"""
Stores information about 1 or more machines in the
~/.asv-machine.json file.
Expand Down Expand Up @@ -80,7 +80,7 @@ def update(cls, _path=None):
util.update_json(cls, path, cls.api_version)


class Machine(object):
class Machine:
"""
Stores information about a particular machine.
"""
Expand Down
2 changes: 1 addition & 1 deletion asv/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import plugins


class PluginManager(object):
class PluginManager:
"""
A class to load and manage plugins.

Expand Down
2 changes: 1 addition & 1 deletion asv/plugins/regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _save_feed(cls, conf, benchmarks, data, revisions, revision_to_hash):
address='{0}.asv'.format(conf.project))


class _GraphDataFilter(object):
class _GraphDataFilter:
"""
Obtain data sets from graphs, following configuration settings.
"""
Expand Down
2 changes: 1 addition & 1 deletion asv/profiling.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

class ProfilerGui(object):
class ProfilerGui:
"""
A base class to define a Profiler GUI that is available through
the ``asv profile`` command.
Expand Down
2 changes: 1 addition & 1 deletion asv/publishing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

class OutputPublisher(object):
class OutputPublisher:
"""
A base class for pages displaying output in the JS application
"""
Expand Down
2 changes: 1 addition & 1 deletion asv/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NoSuchNameError(RuntimeError):
pass


class Repo(object):
class Repo:
"""
Base class for repository handlers.

Expand Down
2 changes: 1 addition & 1 deletion asv/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _compatible_results(result, result_params, params):
return new_results


class Results(object):
class Results:
"""
Manage a set of benchmark results for a single machine and commit
hash.
Expand Down
2 changes: 1 addition & 1 deletion asv/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def _run_benchmark_single_param(benchmark, spawner, param_idx,
util.long_path_rmtree(real_cwd, True)


class Spawner(object):
class Spawner:
"""
Manage launching individual benchmark.py commands
"""
Expand Down
2 changes: 1 addition & 1 deletion asv/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def binom(n, k):
return num // den


class LaplacePosterior(object):
class LaplacePosterior:
"""
Univariate distribution::

Expand Down
2 changes: 1 addition & 1 deletion asv/step_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def merge_pieces(gamma, right, values, dists, mu_dist, max_size):
return right, values, dists


class L1Dist(object):
class L1Dist:
"""
Fast computations for::

Expand Down
2 changes: 1 addition & 1 deletion asv/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def check_call(args, valid_return_codes=(0,), timeout=600, dots=True,
cwd=cwd)


class DebugLogBuffer(object):
class DebugLogBuffer:
def __init__(self, log):
self.buf = []
self.first = True
Expand Down
2 changes: 1 addition & 1 deletion docs/source/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Benchmark attributes can either be applied directly to the benchmark function::

or appear as class attributes::

class SomeBenchmarks(object):
class SomeBenchmarks:
timeout = 123

def time_something(self):
Expand Down
4 changes: 2 additions & 2 deletions test/benchmark/params_examples.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

class ClassOne(object):
class ClassOne:
pass


class ClassTwo(object):
class ClassTwo:
pass


Expand Down
6 changes: 3 additions & 3 deletions test/benchmark/time_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def time_with_timeout():
time_with_timeout.timeout = 0.1


class TimeWithRepeat(object):
class TimeWithRepeat:
# Check that setup is re-run on each repeat
called = None
number = 1
Expand All @@ -70,7 +70,7 @@ def time_it(self):
self.count += 1


class TimeWithRepeatCalibrate(object):
class TimeWithRepeatCalibrate:
# Check that setup is re-run on each repeat, apart from
# autodetection of suitable `number`
repeat = 1
Expand All @@ -84,7 +84,7 @@ def time_it(self):
pass


class TimeWithBadTimer(object):
class TimeWithBadTimer:
# Check that calibration of number is robust against bad timers
repeat = 1
number = 0
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark/timeraw_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

class TimerawSuite(object):
class TimerawSuite:
def timeraw_fresh(self):
# The test interpreter should not be polluted with anything.
return """
Expand Down
4 changes: 2 additions & 2 deletions test/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ON_PYPY = hasattr(sys, 'pypy_version_info')


class ResultsWrapper(object):
class ResultsWrapper:
tuple_type = collections.namedtuple('tuple_type', ['result', 'stats', 'samples',
'params', 'stderr', 'errcode',
'profile', 'started_at', 'duration'])
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_skip_param_selection():
d.update(ASV_CONF_JSON)
conf = config.Config.from_json(d)

class DummyEnv(object):
class DummyEnv:
name = 'env'

d = [
Expand Down
4 changes: 2 additions & 2 deletions test/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def run_asv_with_conf(conf, *argv, **kwargs):
# operations to the repository, and the others should be read-only for
# safety.

class Git(object):
class Git:
def __init__(self, path):
self.path = abspath(path)
self._git = util.which('git')
Expand Down Expand Up @@ -236,7 +236,7 @@ def get_commit_message(self, commit_hash):
"""


class Hg(object):
class Hg:
encoding = 'utf-8'

def __init__(self, path):
Expand Down