[Soap-Python] Why the 'self' parameter in soap decorated methods?

J.Fine j.fine at open.ac.uk
Fri Mar 25 13:23:48 CET 2011


Hi

On the page http://soaplib.github.com/soaplib/2_0/pages/helloworld.html I read

class HelloWorldService(DefinitionBase):
    @soap(String,Integer,_returns=Array(String))
    def say_hello(self,name,times):
        results = []
        for i in range(0,times):
            results.append('Hello, %s'%name)
        return results


What's the purpose of the 'self' in the say_hello method.  Are there any examples of it being used?

(I should add that I'm an experienced Python programmer, and know the purpose of self, and for that matter the staticmethod decorator.)

Best regards


Jonathan

-- 
The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).



More information about the Soap mailing list