REFACTOR: Simplify super() calls

This commit is contained in:
Dominique Barton 2020-02-08 19:36:11 +01:00
parent 8ab8b4de47
commit 3428ed7e04
3 changed files with 5 additions and 5 deletions

View file

@ -38,13 +38,13 @@ class Tag(object):
'''
Implement factory pattern and return correct tag instance.
'''
tag = REGISTRY.get(uid, {})
new_cls = cls.get_class(tag.get('type', ''))
tag = REGISTRY.get(uid, {})
new_cls = cls.get_class(tag.get('type', ''))
if cls is Tag and cls is not new_cls:
instance = new_cls(uid=uid)
else:
instance = super(Tag, cls).__new__(cls, uid=uid)
instance = super().__new__(cls, uid=uid)
instance.registered = bool(tag)
instance.alias = tag.get('alias')

View file

@ -37,7 +37,7 @@ class GPIOHandler(Thread):
:param mopidy.core.Core core: The mopidy core instance
:param threading.Event stop_event: The stop event
'''
super(GPIOHandler, self).__init__()
super().__init__()
self.core = core
self.stop_event = stop_event

View file

@ -44,7 +44,7 @@ class TagReader(Thread):
:param mopidy.core.Core core: The mopidy core instance
:param threading.Event stop_event: The stop event
'''
super(TagReader, self).__init__()
super().__init__()
self.core = core
self.stop_event = stop_event
self.rfid = RFID()