Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-19 Thread Bruno Haible
Collin Funk wrote: > I submitted a feature request here since I think a configuration > option would probably be the best fix: > > https://github.com/pylint-dev/pylint/issues/9555 Thank you! > When I say obvious in GLModule we have (comments are added): > > # Cache for the getter

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-18 Thread Collin Funk
Hi Bruno, On 4/18/24 6:05 AM, Bruno Haible wrote: > The same holds for GCC, glibc, qemu, and many other project: They have > many open issues because the developers prioritize them. They nevertheless > depend on their users for reporting issues. Paul Eggert and I regularly > report issues in GCC,

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-18 Thread Bruno Haible
Hi Collin, > A single underscore doesn't silence it. I can submit a feature request > but it isn't really a bug since it is still an attribute outside of > __init__. IIRC pylint is pretty opinionated and they have many open > issues so who knows if it will even be addressed. The same holds for

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Collin Funk
Hi Bruno, On 4/17/24 3:18 PM, Bruno Haible wrote: > In this example, the property 'attribute' is used outside of the class, > that is, it is public. (In the OO world, the concept of "class" and of > "private"/"public" are tightly related, because one of the main purposes > of a class is to hide

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Bruno Haible
Hi Collin, Both patches applied. > The reason I dislike defining instance variables outside of __init__ > is that you can run into situations like this, which I find hard to > follow: > > var = GLImport(...) # self.assistant does not exist. > var.assistant.do_something() #

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Collin Funk
Hi Bruno, On 4/17/24 11:02 AM, Bruno Haible wrote: >> $ pylint *.py | grep W0201 >> GLError.py:119:12: W0201: Attribute 'message' defined outside __init__ >> (attribute-defined-outside-init) > > This warning is bogus. In a dynamic language like Python, it is > perfectly fine to have a property

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Bruno Haible
Hi Collin, > $ pylint *.py | grep W0201 > GLError.py:119:12: W0201: Attribute 'message' defined outside __init__ > (attribute-defined-outside-init) This warning is bogus. In a dynamic language like Python, it is perfectly fine to have a property used only by one method. Only if it is used by