Move global user cache to a WeakValueDictionary.

This commit is contained in:
Rapptz
2017-01-04 05:16:59 -05:00
parent f8a5d890fe
commit 808a05ff2d
3 changed files with 19 additions and 3 deletions

View File

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