[Python-projects] possible pylint improvement? "Method could be a function"

Aurélien Campéas aurelien.campeas at logilab.fr
Thu Mar 27 17:55:43 CET 2008


On Thu, Mar 27, 2008 at 11:35:17AM -0500, Connor, Adam J wrote:
> Hi, 
> For R0201, "Method could be a function", Pylint gives me false positives
> on implementations like
> 
>     def __lt__(self, other):
>         return NotImplemented

didn't you  mean

         raise NotImplementedError 

?

> 
> even though this would seem a correct implementation when the operation
> is not supported.
> 
> There are lots of possible ways to address it. Currently, I have to turn
> the warnings off, but that is not ideal. I'd rather just turn them off
> for methods starting with double underscores.
> 
> Thanks for the product, though; it is very handy.
> 
> sincerely,
> adam connor
> 
> -- 
> adam connor / adam.connor at austin.utexas.edu
> Sr. Systems Analyst, IT Controller Services
> The University of Texas at Austin
> Phone: (512) 471-1002 Fax: (512) 471-7742
> 
>  
> _______________________________________________
> Python-Projects mailing list
> Python-Projects at lists.logilab.org
> http://lists.logilab.org/mailman/listinfo/python-projects
> 


More information about the Python-Projects mailing list