pylint -- should I just ignore it sometimes?

Seebs usenet-nospam at seebs.net
Tue Oct 19 18:36:00 EDT 2010


On 2010-10-19, Martin P. Hellwig <martin.hellwig at dcuktec.org> wrote:
> Well, as with all styles IMHO, if there is a _good_ reason to break it, 
> then by all means do, but you might want to consider putting in a 
> comment why you did that and add the #pylint: disable-msg=<message_id> 
> on that line. If that is overkill, why not just comply to the standard 
> and avoid all the fuzz?

Well, part of what I'm trying to understand is why the standard in question
says what it says.  I'm pretty much mystified by a claim that something with
seven instance attributes is "too complicated".  For instance, I've got a
class which represents (approximately) a C function, for use in writing
various wrappers related to it.  It has name, return type, args, default
values, a list of arguments which need various modifications, a default
return value, and so on... And it ends up with, apparently, 10 instance
attributes.

I can't tell whether there's actually a general consensus that classes
should never be nearly that complicated, or whether pylint is being a little
dogmatic here -- I haven't seen enough other Python to be sure.  I'm
used to having objects with anywhere from two or three to a dozen or more
attributes, depending on what kind of thing they model.  It seems like a
very odd measure of complexity; is it really that unusual for objects to have
more than seven meaningful attributes?

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.



More information about the Python-list mailing list