Skip to content

Commit cf500e0

Browse files
pylint: fix unnecessary-lambda-assignment cases
Fix all cases of C3001 unnecessary-lambda-assignment. Part of #270
1 parent 3090a48 commit cf500e0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tarantool/request.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ def packer_factory(conn):
115115
# We need configured packer to work with error extention
116116
# type payload, but module do not provide access to self
117117
# inside extension type packers.
118-
packer_no_ext = msgpack.Packer(**packer_kwargs)
119-
default = lambda obj: packer_default(obj, packer_no_ext)
118+
def default(obj):
119+
packer_no_ext = msgpack.Packer(**packer_kwargs)
120+
return packer_default(obj, packer_no_ext)
120121
packer_kwargs['default'] = default
121122

122123
return msgpack.Packer(**packer_kwargs)

tarantool/response.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ def unpacker_factory(conn):
7878
# We need configured unpacker to work with error extention
7979
# type payload, but module do not provide access to self
8080
# inside extension type unpackers.
81-
unpacker_no_ext = msgpack.Unpacker(**unpacker_kwargs)
82-
ext_hook = lambda code, data: unpacker_ext_hook(code, data, unpacker_no_ext)
81+
def ext_hook(code, data):
82+
unpacker_no_ext = msgpack.Unpacker(**unpacker_kwargs)
83+
return unpacker_ext_hook(code, data, unpacker_no_ext)
8384
unpacker_kwargs['ext_hook'] = ext_hook
8485

8586
return msgpack.Unpacker(**unpacker_kwargs)

0 commit comments

Comments
 (0)