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

Igor Munkin imun at tarantool.org
Mon Aug 7 14:00:44 MSK 2023


Sergey,

Thanks for your review!

On 03.08.23, Sergey Bronnikov wrote:
> Hi, Igor
> 
> thanks for the patch!
> 
> On 8/3/23 10:30, Igor Munkin wrote:
> > 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 at 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), (
> 
> it is not obvious why variable "l" was replaced by "coroutine".
> 
> Could you elaborate? The same below

It's quite clear (at least for me): lua_State represents Lua coroutine
within low level space. However, I've already fixed it to "lstate" as
Max suggested (you can find the incremental diff in my reply).

> 
> 
> >           # 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):

<snipped>

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list