[Python-projects] R0902 and R0904 Inconsistent?

Meding, Olaf Olaf.Meding at bruker-axs.com
Mon May 1 15:35:57 CEST 2006


Marc

It would be great if different message codes could be used.  One for counting attributes/methods for the current class and another for all inherited classes.

The user of a class may not have control over base the base class design.


Olaf




-----Original Message-----
From: python-projects-bounces at lists.logilab.org
[mailto:python-projects-bounces at lists.logilab.org]On Behalf Of Marc
'BlackJack' Rintsch
Sent: Saturday, April 29, 2006 5:25 PM
To: python-projects at lists.logilab.org
Subject: Re: [Python-projects] R0902 and R0904 Inconsistent?


On Friday 28 April 2006 17:25, Meding, Olaf wrote:
> The R0902 (Too many instance attributes) does not count inherited
> attributes.  However, the R0904 (Too many public methods) does count
> inherited methods.
>
> I wonder if the R0904 should not count inherited methods?

I guess the reason is to warn if an object grows too many methods.  An 
object with 200+ methods doesn't get better if those methods are spread 
across an inheritance tree.  The same reason applies to attributes, so 
R0902 maybe should count inherited attributes too.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
“Don't be too sure that it's compatible for the indefinite future.
 XML is just as future-proof as any other format.” -- Sybren Stuvel


More information about the Python-Projects mailing list