Pylint false positives

Chris Angelico rosuav at gmail.com
Mon Aug 20 14:03:06 EDT 2018


On Tue, Aug 21, 2018 at 2:12 AM, Dan Sommers <dan at tombstonezero.net> wrote:
> On Mon, 20 Aug 2018 14:39:38 +0000, Steven D'Aprano wrote:
>
>> If a class' methods don't use self, it probably shouldn't be a class.
>
> Agreed.
>
>> I have often wished Python had proper namespaces, so I didn't have to
>> abuse classes as containers in this way :-(
>>
>> (Not that I do this using "inner classes", but I do often want to use
>> a class as a container for functions, without caring about "self" or
>> wrapping everything in staticmethod.)
>
> Isn't that what modules are for?  (I suspect that I'm missing something,
> because I also suspect that you knew/know that.)

Yes, except that sometimes you want submodules without going for a
package with modules inside it.

ChrisA



More information about the Python-list mailing list