Skip to content

Commit

Permalink
embed lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Nov 15, 2019
1 parent b82ff8f commit 494e129
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pyls/plugins/importmagic_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def _tokenize(source):
Returns only NAME tokens.
"""
readline = _SourceReader(source).readline
filter_name = lambda token: token[0] == tokenize.NAME
return filter(filter_name, tokenize.generate_tokens(readline))
return filter(lambda token: token[0] == tokenize.NAME, tokenize.generate_tokens(readline))


def _search_symbol(source, symbol):
Expand All @@ -108,9 +107,8 @@ def _search_symbol(source, symbol):
symbol_tokens = list(_tokenize(symbol))
source_tokens = list(_tokenize(source))

get_str = lambda token: token[1]
symbol_tokens_str = list(map(get_str, symbol_tokens))
source_tokens_str = list(map(get_str, source_tokens))
symbol_tokens_str = list(map(lambda token: token[1], symbol_tokens))
source_tokens_str = list(map(lambda token: token[1], source_tokens))

symbol_len = len(symbol_tokens)
locations = []
Expand Down

0 comments on commit 494e129

Please sign in to comment.