Add __slots__ where appropriate to data classes.

This commit is contained in:
Rapptz
2015-12-19 06:18:12 -05:00
parent 4fa5b50d2b
commit f1f0e169e4
10 changed files with 33 additions and 12 deletions

View File

@ -53,8 +53,8 @@ class Role(Hashable):
The name of the role.
permissions : :class:`Permissions`
Represents the role's permissions.
color : :class:`Colour`
Represents the role colour.
colour : :class:`Colour`
Represents the role colour. An alias exists under ``color``.
hoist : bool
Indicates if the role will be displayed separately from other members.
position : int
@ -64,6 +64,9 @@ class Role(Hashable):
integrations such as Twitch.
"""
__slots__ = ['id', 'name', 'permissions', 'color', 'colour', 'position',
'managed', '_is_everyone', 'hoist' ]
def __init__(self, **kwargs):
self._is_everyone = kwargs.get('everyone', False)
self.update(**kwargs)