[Tarantool-patches] [PATCH luajit 14/15] test: fix E741 errors by pycodestyle

Igor Munkin imun at tarantool.org
Mon Aug 7 13:57:14 MSK 2023


Max,

Thanks for your review! For me it's totally the same (you can see I use
the term 'coro' in the comments right there), but I don't mind your
naming, so fixed. Here is the diff:

================================================================================

diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
index 2e0b145b..9075e99f 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 coroutine in [L] + list(map(lambda main: lookup(main), (
+    for lstate 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 coroutine:
-            return cast('lua_State *', coroutine)
+        if lstate:
+            return cast('lua_State *', lstate)
 
 
 def G(L):
diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py
index 76fb3141..85c0dcb9 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 coroutine in [L] + list(map(lambda main: lookup_global(main), (
+    for lstate 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 coroutine:
-            return lua_State(coroutine)
+        if lstate:
+            return lua_State(lstate)
 
 
 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):
-        coro = self.parse(args)
-        coro_ptr = cast('lua_State *', coro) if coro is not None else None
-        print('{}'.format(dump_stack(L(coro_ptr))))
+        lstate = self.parse(args)
+        lstate_ptr = cast('lua_State *', lstate) if coro is not None else None
+        print('{}'.format(dump_stack(L(lstate_ptr))))
 
 
 def register_commands(debugger, commands):

================================================================================

On 03.08.23, Maxim Kokryashkin wrote:
> 
> 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
>  
>   

<snipped>

>  

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list