aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHornwitser <[email protected]>2018-06-22 15:59:12 +0200
committerRapptz <[email protected]>2018-08-22 21:43:52 -0400
commit3679819c5351dc839b6611462a169e68bb02dd4e (patch)
tree1a6c8674998f1d05828d5f5b8550f536c3720844
parent[lint] Remove unused variables (diff)
downloaddiscord.py-3679819c5351dc839b6611462a169e68bb02dd4e.tar.xz
discord.py-3679819c5351dc839b6611462a169e68bb02dd4e.zip
[lint] Remove unnecessary lambdas
Lambdas of the form `lambda x: func(x)` are redundant.
-rw-r--r--discord/calls.py2
-rw-r--r--discord/ext/commands/bot.py2
-rw-r--r--discord/message.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/discord/calls.py b/discord/calls.py
index 0f340742..bbffa7da 100644
--- a/discord/calls.py
+++ b/discord/calls.py
@@ -110,7 +110,7 @@ class GroupCall:
lookup = {u.id: u for u in self.call.channel.recipients}
me = self.call.channel.me
lookup[me.id] = me
- self.ringing = list(filter(None, map(lambda i: lookup.get(i), kwargs.get('ringing', []))))
+ self.ringing = list(filter(None, map(lookup.get, kwargs.get('ringing', []))))
def _update_voice_state(self, data):
user_id = int(data['user_id'])
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index 71ec5189..2dd22772 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -137,7 +137,7 @@ async def _default_help_command(ctx, *commands : str):
pages = await bot.formatter.format_help_for(ctx, command)
if bot.pm_help is None:
- characters = sum(map(lambda l: len(l), pages))
+ characters = sum(map(len, pages))
# modify destination based on length of pages.
if characters > 1000:
destination = ctx.message.author
diff --git a/discord/message.py b/discord/message.py
index 526738e8..c6559616 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -366,7 +366,7 @@ class Message:
def channel_mentions(self):
if self.guild is None:
return []
- it = filter(None, map(lambda m: self.guild.get_channel(m), self.raw_channel_mentions))
+ it = filter(None, map(self.guild.get_channel, self.raw_channel_mentions))
return utils._unique(it)
@utils.cached_slot_property('_cs_clean_content')