Skip to content

Commit bc77a05

Browse files
committed
Fix some flake8 errors
1 parent 3db284b commit bc77a05

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

neovim/api/common.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def __contains__(self, item):
115115
return False
116116

117117

118+
def _identity(obj, session, method, kind):
119+
return obj
120+
121+
118122
class SessionHook(object):
119123

120124
"""Pair of functions to filter objects coming/going from/to Nvim.
@@ -134,9 +138,7 @@ class SessionHook(object):
134138
This class also provides a `compose` method for composing hooks.
135139
"""
136140

137-
identity = lambda obj, session, method, kind: obj
138-
139-
def __init__(self, from_nvim=identity, to_nvim=identity):
141+
def __init__(self, from_nvim=_identity, to_nvim=_identity):
140142
"""Initialize a SessionHook with from/to filters."""
141143
self.from_nvim = from_nvim
142144
self.to_nvim = to_nvim
@@ -148,9 +150,9 @@ def compose(self, other):
148150
a new SessionHook instance with the composed filters.
149151
"""
150152
def comp(f1, f2):
151-
if f1 is SessionHook.identity:
153+
if f1 is _identity:
152154
return f2
153-
if f2 is SessionHook.identity:
155+
if f2 is _identity:
154156
return f1
155157
return lambda o, s, m, k: f1(f2(o, s, m, k), s, m, k)
156158

neovim/plugin/host.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def _discover_classes(self, module, handlers, plugin_path):
116116
self._discover_functions(plugin, handlers, plugin_path)
117117

118118
def _discover_functions(self, obj, handlers, plugin_path):
119-
predicate = lambda o: hasattr(o, '_nvim_rpc_method_name')
119+
def predicate(o):
120+
return hasattr(o, '_nvim_rpc_method_name')
120121
specs = []
121122
for _, fn in inspect.getmembers(obj, predicate):
122123
if fn._nvim_bind:

neovim/ui/tickit_ui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ def interrupt():
377377
bridge.input('<C-c>')
378378

379379
def input_check():
380-
check_timeout = lambda: lib.tickit_term_input_check_timeout(tt)
380+
def check_timeout():
381+
return lib.tickit_term_input_check_timeout(tt)
381382
lib.tickit_term_input_readable(tt)
382383
sleep = check_timeout()
383384
if sleep != -1:

0 commit comments

Comments
 (0)