From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: fix some flake8 F824 warnings
Date: Thu, 24 Apr 2025 15:33:39 -0400 [thread overview]
Message-ID: <5eec1219-a2c6-4a35-8238-e682a235f0a1@polymtl.ca> (raw)
In-Reply-To: <87v7qt4ave.fsf@tromey.com>
On 2025-04-24 15:28, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
> Simon> flake8 7.2.0 appears to have this new warning:
>
> Simon> F824: global name / nonlocal name is unused: name is never assigned in scope
>
> Simon> It points out a few places in our code base where "global" is not
> Simon> necessary, fix them.
>
> I'm mildly meh about this since I find "global" easier to follow, but at
> the same time I'm sure we use this style in some spots already anyway.
Yeah, since Python doesn't require it, it means we'll have some spots
that use it and some that don't. To make it clear a variable is global,
I would suggest adopting a naming standard that makes it obvious.
Global variables are often prefixed with `_`, which is a good indication
already.
Simon
next prev parent reply other threads:[~2025-04-24 19:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 18:48 simon.marchi
2025-04-24 18:48 ` [PATCH 2/2] pre-commit autoupdate simon.marchi
2025-04-24 19:29 ` Tom Tromey
2025-04-24 19:35 ` Simon Marchi
2025-04-24 19:28 ` [PATCH 1/2] gdb: fix some flake8 F824 warnings Tom Tromey
2025-04-24 19:33 ` Simon Marchi [this message]
2025-04-24 20:58 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5eec1219-a2c6-4a35-8238-e682a235f0a1@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox