Re: pylint -- should I just ignore it sometimes?
- From: Seebs <usenet-nospam@xxxxxxxxx>
- Date: 19 Oct 2010 22:36:00 GMT
On 2010-10-19, Martin P. Hellwig <martin.hellwig@xxxxxxxxxxx> 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@xxxxxxxxx
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.
.
- Follow-Ups:
- Code smells: too many parameters, too many attributes (was: pylint -- should I just ignore it sometimes?)
- From: Ben Finney
- Re: pylint -- should I just ignore it sometimes?
- From: Alexander Kapps
- Re: pylint -- should I just ignore it sometimes?
- From: Martin P. Hellwig
- Code smells: too many parameters, too many attributes (was: pylint -- should I just ignore it sometimes?)
- References:
- pylint -- should I just ignore it sometimes?
- From: Seebs
- Re: pylint -- should I just ignore it sometimes?
- From: Martin P. Hellwig
- pylint -- should I just ignore it sometimes?
- Prev by Date: Re: Starting Python in XP Pro
- Next by Date: Re: pylint -- should I just ignore it sometimes?
- Previous by thread: Re: pylint -- should I just ignore it sometimes?
- Next by thread: Re: pylint -- should I just ignore it sometimes?
- Index(es):
Relevant Pages
|