Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit] gdb: fix flake-7.2.0 F824 warning
@ 2025-05-14  9:38 Sergey Kaplun via Tarantool-patches
  2025-05-14 10:51 ` Sergey Bronnikov via Tarantool-patches
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2025-05-14  9:38 UTC (permalink / raw)
  To: Sergey Bronnikov; +Cc: tarantool-patches

This patch fixes the flake8 warning F824 [1]:

| F824 `global gtype_cache` is unused: name is never assigned in scope

This patch removes the `global` definition inside the function since,
according to [2], it's already considered global.

[1]: https://flake8.pycqa.org/en/latest/user/error-codes.html
[2]: https://docs.python.org/3/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python
---

Branch: https://github.com/tarantool/luajit/tree/skaplun/fix-flake8-7.2.0

The workflow isn't updated since this version of flake8 is unavailable
for the python 3.8. OTOH, action/setup-python shouldn't be run on
self-hosted runners, see [3].

[3]: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner

 src/luajit-gdb.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
index d2070e9b..0ae2a6e0 100644
--- a/src/luajit-gdb.py
+++ b/src/luajit-gdb.py
@@ -23,7 +23,6 @@ gtype_cache = {}
 
 
 def gtype(typestr):
-    global gtype_cache
     if typestr in gtype_cache:
         return gtype_cache[typestr]
 
-- 
2.49.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] gdb: fix flake-7.2.0 F824 warning
  2025-05-14  9:38 [Tarantool-patches] [PATCH luajit] gdb: fix flake-7.2.0 F824 warning Sergey Kaplun via Tarantool-patches
@ 2025-05-14 10:51 ` Sergey Bronnikov via Tarantool-patches
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2025-05-14 10:51 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Hi, Sergey,

thanks for the patch! LGTM

On 5/14/25 12:38, Sergey Kaplun wrote:
> This patch fixes the flake8 warning F824 [1]:
>
> | F824 `global gtype_cache` is unused: name is never assigned in scope
>
> This patch removes the `global` definition inside the function since,
> according to [2], it's already considered global.
>
> [1]:https://flake8.pycqa.org/en/latest/user/error-codes.html
> [2]:https://docs.python.org/3/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python
> ---
>
> Branch:https://github.com/tarantool/luajit/tree/skaplun/fix-flake8-7.2.0
>
> The workflow isn't updated since this version of flake8 is unavailable
> for the python 3.8. OTOH, action/setup-python shouldn't be run on
> self-hosted runners, see [3].
>
> [3]:https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner
>
>   src/luajit-gdb.py | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
> index d2070e9b..0ae2a6e0 100644
> --- a/src/luajit-gdb.py
> +++ b/src/luajit-gdb.py
> @@ -23,7 +23,6 @@ gtype_cache = {}
>   
>   
>   def gtype(typestr):
> -    global gtype_cache
>       if typestr in gtype_cache:
>           return gtype_cache[typestr]
>   

[-- Attachment #2: Type: text/html, Size: 2194 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-14 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-14  9:38 [Tarantool-patches] [PATCH luajit] gdb: fix flake-7.2.0 F824 warning Sergey Kaplun via Tarantool-patches
2025-05-14 10:51 ` Sergey Bronnikov via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox