Use super() in classes that could be subclassed.

This commit is contained in:
Rapptz 2016-01-04 18:25:20 -05:00
parent 5a1d7a2d94
commit 948f565b43
3 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,7 @@ class Client:
"""
def __init__(self, *, loop=None, **options):
super().__init__(loop, **options)
self.ws = None
self.token = None
self.gateway = None

View File

@ -44,4 +44,5 @@ class Object:
"""
def __init__(self, id):
super().__init__(id)
self.id = id

View File

@ -56,6 +56,7 @@ class User:
__slots__ = ['name', 'id', 'discriminator', 'avatar']
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.name = kwargs.get('username')
self.id = kwargs.get('id')
self.discriminator = kwargs.get('discriminator')