Slots use tuples instead now.

This commit is contained in:
Rapptz 2016-10-11 00:57:41 -04:00
parent b9dafe375f
commit e4b16851bf
7 changed files with 8 additions and 8 deletions

View File

@ -353,7 +353,7 @@ class PrivateChannel(Hashable):
:attr:`ChannelType.group` then this is always ``None``. :attr:`ChannelType.group` then this is always ``None``.
""" """
__slots__ = ['id', 'recipients', 'type', 'owner', 'icon', 'name', 'me', '_state'] __slots__ = ('id', 'recipients', 'type', 'owner', 'icon', 'name', 'me', '_state')
def __init__(self, *, me, state, data): def __init__(self, *, me, state, data):
self._state = state self._state = state

View File

@ -50,7 +50,7 @@ class Colour:
The raw integer colour value. The raw integer colour value.
""" """
__slots__ = [ 'value' ] __slots__ = ('value',)
def __init__(self, value): def __init__(self, value):
self.value = value self.value = value

View File

@ -35,7 +35,7 @@ class BucketType(enum.Enum):
channel = 3 channel = 3
class Cooldown: class Cooldown:
__slots__ = ['rate', 'per', 'type', '_window', '_tokens', '_last'] __slots__ = ('rate', 'per', 'type', '_window', '_tokens', '_last')
def __init__(self, rate, per, type): def __init__(self, rate, per, type):
self.rate = int(rate) self.rate = int(rate)

View File

@ -51,7 +51,7 @@ class Game:
The type of game being played. 1 indicates "Streaming". The type of game being played. 1 indicates "Streaming".
""" """
__slots__ = ['name', 'type', 'url'] __slots__ = ('name', 'type', 'url')
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.name = kwargs.get('name') self.name = kwargs.get('name')

View File

@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
""" """
class EqualityComparable: class EqualityComparable:
__slots__ = [] __slots__ = ()
def __eq__(self, other): def __eq__(self, other):
return isinstance(other, self.__class__) and other.id == self.id return isinstance(other, self.__class__) and other.id == self.id
@ -36,7 +36,7 @@ class EqualityComparable:
return True return True
class Hashable(EqualityComparable): class Hashable(EqualityComparable):
__slots__ = [] __slots__ = ()
def __hash__(self): def __hash__(self):
return hash(self.id) return hash(self.id)

View File

@ -67,7 +67,7 @@ class Permissions:
permissions via the properties rather than using this raw value. permissions via the properties rather than using this raw value.
""" """
__slots__ = [ 'value' ] __slots__ = ('value',)
def __init__(self, permissions=0, **kwargs): def __init__(self, permissions=0, **kwargs):
self.value = permissions self.value = permissions

View File

@ -58,7 +58,7 @@ class User:
Specifies if the user is a bot account. Specifies if the user is a bot account.
""" """
__slots__ = ['name', 'id', 'discriminator', 'avatar', 'bot', '_state'] __slots__ = ('name', 'id', 'discriminator', 'avatar', 'bot', '_state')
def __init__(self, *, state, data): def __init__(self, *, state, data):
self._state = state self._state = state