diff options
| author | Rapptz <[email protected]> | 2015-12-30 16:11:15 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-30 16:11:15 -0500 |
| commit | c69a991e4649b2c3e10cdd2fc1ec1444c548f419 (patch) | |
| tree | df4e36cdd028c54dae3fea84cd4033c96dd14a6a /discord/utils.py | |
| parent | utils.get now supports nested attribute retrieval. (diff) | |
| download | discord.py-c69a991e4649b2c3e10cdd2fc1ec1444c548f419.tar.xz discord.py-c69a991e4649b2c3e10cdd2fc1ec1444c548f419.zip | |
Maintain order in role related functions.
Diffstat (limited to 'discord/utils.py')
| -rw-r--r-- | discord/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/utils.py b/discord/utils.py index 74c070c8..e74c2e99 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -137,6 +137,11 @@ def get(iterable, **attrs): return find(predicate, iterable) +def _unique(iterable): + seen = set() + adder = seen.add + return [x for x in iterable if not (x in seen or adder(x))] + def _null_event(*args, **kwargs): pass |