graphite-project / carbon

Useless inheritance from object PYL-R0205
Anti-pattern
Major
8 months ago4 years old
Class 'DatapointRouter' inherits from object, can be safely removed from bases in python3
  4from six.moves import xrange
  5
  6
  7class DatapointRouter(with_metaclass(PluginRegistrar, object)):  8  "Abstract base class for datapoint routing logic implementations"
  9  plugins = {}
 10
Class '_FakeService' inherits from object, can be safely removed from bases in python3
 36    plugins = sorted(MetricReceiver.plugins.keys())
 37    self.assertEqual(expected_plugins, plugins)
 38
 39    class _FakeService(object): 40      def addService(_, __):
 41        pass
 42    fake_service = _FakeService()
Class 'FastHashRing' inherits from object, can be safely removed from bases in python3
174      yield destination
175
176
177class FastHashRing(object):178  """A very fast hash 'ring'.
179
180  Instead of trying to avoid rebalancing data when changing
Class 'TagQueue' inherits from object, can be safely removed from bases in python3
 51  UPDATE_BUCKET = TokenBucket(capacity, fill_rate)
 52
 53
 54class TagQueue(object): 55  def __init__(self, maxsize=0, update_interval=1):
 56    self.add_queue = queue.Queue(maxsize)
 57    self.update_queue = queue.Queue(maxsize)
Class 'SafeUnpickler' inherits from object, can be safely removed from bases in python3
218# The SafeUnpickler classes were largely derived from
219# http://nadiana.com/python-pickle-insecure
220if USING_CPICKLE:
221  class SafeUnpickler(object):222    PICKLE_SAFE = {
223      'copy_reg': set(['_reconstructor']),
224      '__builtin__': set(['object']),