PyChecker "self is argument in staticmethod"

Peter Hansen peter at engcorp.com
Thu Nov 18 12:18:02 EST 2004


Olaf Meding wrote:
> What does the below PyChecker warning mean?
> 
> More importantly, is there a way to suppress it?
> 
>  PyChecker warning:
>   ..\src\phaseid\integration.py:21: self is argument in staticmethod
> 
> My best guess is that the warning is related to PyChecker not
> supporting C++ extensions.

Sounds like a pretty wild guess to me. ;-)

c:\>c:\a\python23\python.exe 
c:\a\python23\Lib\site-packages\pychecker\checker.py test.py
Processing test...

Warnings...

test.py:2: self is argument in staticmethod

c:\>type test.py
class A:
     def func(self, blah):
         pass

     func = staticmethod(func)


Does your code look anything like the above?  The warning message
is very explicit about what is wrong here...  a staticmethod
should not really have a "self" parameter.

-Peter



More information about the Python-list mailing list