lyx2lyx: many unused variables (any bugs?)

Thibaut Cuvelier dourouc05 at gmail.com
Thu Dec 8 20:37:16 UTC 2022


On Thu, 8 Dec 2022 at 21:19, Richard Kimberly Heck <rikiheck at gmail.com>
wrote:

> On 12/8/22 13:45, Scott Kostyshak wrote:
> > Perhaps it doesn't make sense to clean up lyx_2_4.py (except for looking
> > for bugs), but what would you think about adding an agreed-upon set of
> > pylint warnings to our test suite for lyx_2_5.py?
>
> I don't think it could hurt.
>

+1, and even to run these kinds of checks during tests.


> > lyx_2_4.py:836:16: W0612: Unused variable 'k' (unused-variable)
>
> This is a weird one. Jürgen should have a look. Probably it's harmless.
> Basically, it's the loop variable, and it's not actually being used in
> the loop, just to control the number of iterations. So it might just be
> a style thing more than a substance thing.
>

The Python standard for variables that are introduced just because the
syntax requires it (like iterating X times) is to name that variable _ (or
to prefix it with an underscore if there are more than one). For
instance, pylint
recognises this <https://github.com/PyCQA/pylint/issues/1058>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221208/cc7b63e1/attachment.html>


More information about the lyx-devel mailing list