diff --git a/README.rst b/README.rst index aeb971a4d..ff598c4e0 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,7 @@ To use Ray's actor model: ray.init() @ray.remote - class Counter(): + class Counter(object): def __init__(self): self.n = 0 diff --git a/ci/performance_tests/test_performance.py b/ci/performance_tests/test_performance.py index 19a593583..c020343f1 100644 --- a/ci/performance_tests/test_performance.py +++ b/ci/performance_tests/test_performance.py @@ -119,7 +119,7 @@ def no_op(*values): @ray.remote -class Actor(): +class Actor(object): def ping(self, *values): pass diff --git a/doc/examples/doc_code/tf_example.py b/doc/examples/doc_code/tf_example.py index 505bc543b..01a7f5d4c 100644 --- a/doc/examples/doc_code/tf_example.py +++ b/doc/examples/doc_code/tf_example.py @@ -48,7 +48,7 @@ def random_one_hot_labels(shape): # Use GPU wth # @ray.remote(num_gpus=1) @ray.remote -class Network(): +class Network(object): def __init__(self): self.model = create_keras_model() self.dataset = np.random.random((1000, 32)) diff --git a/doc/examples/doc_code/torch_example.py b/doc/examples/doc_code/torch_example.py index b89f6b5ae..77f2a0ae6 100644 --- a/doc/examples/doc_code/torch_example.py +++ b/doc/examples/doc_code/torch_example.py @@ -113,7 +113,7 @@ def dataset_creators(use_cuda): import torch.optim as optim -class Network(): +class Network(object): def __init__(self, lr=0.01, momentum=0.5): use_cuda = torch.cuda.is_available() self.device = device = torch.device("cuda" if use_cuda else "cpu") diff --git a/doc/examples/plot_pong_example.py b/doc/examples/plot_pong_example.py index 9b0ef73dd..4c2b381de 100644 --- a/doc/examples/plot_pong_example.py +++ b/doc/examples/plot_pong_example.py @@ -156,7 +156,7 @@ def rollout(model, env): # given an input, which in our case is an observation. -class Model(): +class Model(object): """This class holds the neural network weights.""" def __init__(self): diff --git a/doc/source/index.rst b/doc/source/index.rst index 21d0b695e..5583ecc14 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -52,7 +52,7 @@ To use Ray's actor model: ray.init() @ray.remote - class Counter(): + class Counter(object): def __init__(self): self.n = 0 diff --git a/python/ray/autoscaler/autoscaler.py b/python/ray/autoscaler/autoscaler.py index f6b389134..61ef92fc8 100644 --- a/python/ray/autoscaler/autoscaler.py +++ b/python/ray/autoscaler/autoscaler.py @@ -354,7 +354,7 @@ class NodeLauncher(threading.Thread): logger.info(prefix + " {}".format(statement)) -class ConcurrentCounter(): +class ConcurrentCounter(object): def __init__(self): self._value = 0 self._lock = threading.Lock() diff --git a/python/ray/autoscaler/log_timer.py b/python/ray/autoscaler/log_timer.py index 935f46b61..7506257d5 100644 --- a/python/ray/autoscaler/log_timer.py +++ b/python/ray/autoscaler/log_timer.py @@ -8,7 +8,7 @@ import logging logger = logging.getLogger(__name__) -class LogTimer(): +class LogTimer(object): def __init__(self, message): self._message = message diff --git a/python/ray/experimental/serve/tests/test_metric.py b/python/ray/experimental/serve/tests/test_metric.py index 84c5f7f3d..d60cb20f5 100644 --- a/python/ray/experimental/serve/tests/test_metric.py +++ b/python/ray/experimental/serve/tests/test_metric.py @@ -9,7 +9,7 @@ from ray.experimental.serve.metric import MetricMonitor @pytest.fixture(scope="session") def start_target_actor(ray_instance): @ray.remote - class Target(): + class Target(object): def __init__(self): self.counter_value = 0 diff --git a/python/ray/tune/log_sync.py b/python/ray/tune/log_sync.py index a2769af87..8d8433dfc 100644 --- a/python/ray/tune/log_sync.py +++ b/python/ray/tune/log_sync.py @@ -41,7 +41,7 @@ def log_sync_template(): ).format(ssh_key=quote(ssh_key)) -class NodeSyncMixin(): +class NodeSyncMixin(object): """Mixin for syncing files to/from a remote dir to a local dir.""" def __init__(self): diff --git a/python/ray/tune/schedulers/hyperband.py b/python/ray/tune/schedulers/hyperband.py index 064ae09aa..2ed6ecfdf 100644 --- a/python/ray/tune/schedulers/hyperband.py +++ b/python/ray/tune/schedulers/hyperband.py @@ -294,7 +294,7 @@ class HyperBandScheduler(FIFOScheduler): trial_runner.trial_executor.unpause_trial(trial) -class Bracket(): +class Bracket(object): """Logical object for tracking Hyperband bracket progress. Keeps track of proper parameters as designated by HyperBand. diff --git a/python/ray/tune/tests/test_commands.py b/python/ray/tune/tests/test_commands.py index f640260be..8234ffd79 100644 --- a/python/ray/tune/tests/test_commands.py +++ b/python/ray/tune/tests/test_commands.py @@ -20,7 +20,7 @@ from ray.tune import commands from ray.tune.result import CONFIG_PREFIX -class Capturing(): +class Capturing(object): def __enter__(self): self._stdout = sys.stdout sys.stdout = self._stringio = StringIO()