Maximum Number of Class Attributes

B

Bob Parnes

In its default configuration, my version of pylint (0.5.0) sets the
maximum number of class attributes at 7. This seems low to me, but I
can see how an excessive number might make maintenance more
difficult. Is this indeed the best value for a maximum under ordinary
conditions? If not, can anyone suggest a more reasonable value?

Thanks in advance.

Bob Parnes
 
S

Sylvain Thenault

In its default configuration, my version of pylint (0.5.0) sets the
maximum number of class attributes at 7. This seems low to me, but I can
see how an excessive number might make maintenance more difficult. Is this
indeed the best value for a maximum under ordinary conditions? If not, can
anyone suggest a more reasonable value?

well, this value is very subjective, and may change from one context to
another... For instance at some point I hope that pylint will detect "GUI"
classes and allow more attributes (and methods?) to those.
Anyway that's just an indicator, not a rule of thumb (and pylint itself
has some class with more than 7 attributes...).

And FYI, this value has been taken from a post to the
testdrivendevelopment at yahoogroups (as most others default values in the
"design analysis" checker). Hum, well... After checking it seems that the
post said 20 attributes. I don't remember why did i get this number down
to 7. If this discussion leads to an agreement for a better number, I
can change the default value.
 
B

Bob Parnes

well, this value is very subjective, and may change from one context to
another... For instance at some point I hope that pylint will detect "GUI"
classes and allow more attributes (and methods?) to those.
Anyway that's just an indicator, not a rule of thumb (and pylint itself
has some class with more than 7 attributes...).

And FYI, this value has been taken from a post to the
testdrivendevelopment at yahoogroups (as most others default values in the
"design analysis" checker). Hum, well... After checking it seems that the
post said 20 attributes. I don't remember why did i get this number down
to 7. If this discussion leads to an agreement for a better number, I
can change the default value.

Thanks for the information. I *am* using gui classes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top