Hi, Igor!
Thanks for the patch!
I don’t think `coroutine` is a great name.`lua_state` seems
to be a better option here.
--
Best regards,
Maxim Kokryashkin
 
 
Четверг, 3 августа 2023, 10:44 +03:00 от Igor Munkin <imun@tarantool.org>:
 
Fixed 3 occurrences of E741 ("ambiguous variable name 'l'") error
reported by pycodestyle[1].

[1]: https://www.flake8rules.com/rules/E741.html

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 src/luajit-gdb.py | 6 +++---
 src/luajit_lldb.py | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
index a0c8f24e..2e0b145b 100644
--- a/src/luajit-gdb.py
+++ b/src/luajit-gdb.py
@@ -233,15 +233,15 @@ def L(L=None):
     # lookup a symbol for the main coroutine considering the host app
     # XXX Fragile: though the loop initialization looks like a crap but it
     # respects both Python 2 and Python 3.
- for l in [L] + list(map(lambda l: lookup(l), (
+ for coroutine in [L] + list(map(lambda main: lookup(main), (
         # LuaJIT main coro (see luajit/src/luajit.c)
         'globalL',
         # Tarantool main coro (see tarantool/src/lua/init.h)
         'tarantool_L',
         # TODO: Add more
     ))):
- if l:
- return cast('lua_State *', l)
+ if coroutine:
+ return cast('lua_State *', coroutine)
 
 
 def G(L):
diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py
index 4787c62c..76fb3141 100644
--- a/src/luajit_lldb.py
+++ b/src/luajit_lldb.py
@@ -453,15 +453,15 @@ def L(L=None):
     # lookup a symbol for the main coroutine considering the host app
     # XXX Fragile: though the loop initialization looks like a crap but it
     # respects both Python 2 and Python 3.
- for l in [L] + list(map(lambda l: lookup_global(l), (
+ for coroutine in [L] + list(map(lambda main: lookup_global(main), (
         # LuaJIT main coro (see luajit/src/luajit.c)
         'globalL',
         # Tarantool main coro (see tarantool/src/lua/init.h)
         'tarantool_L',
         # TODO: Add more
     ))):
- if l:
- return lua_State(l)
+ if coroutine:
+ return lua_State(coroutine)
 
 
 def tou32(val):
@@ -1066,9 +1066,9 @@ coroutine guest stack:
 If L is ommited the main coroutine is used.
     '''
     def execute(self, debugger, args, result):
- l = self.parse(args)
- l_ptr = cast('lua_State *', l) if l is not None else None
- print('{}'.format(dump_stack(L(l_ptr))))
+ coro = self.parse(args)
+ coro_ptr = cast('lua_State *', coro) if coro is not None else None
+ print('{}'.format(dump_stack(L(coro_ptr))))
 
 
 def register_commands(debugger, commands):
--
2.30.2