Skip to content

Instantly share code, notes, and snippets.

@trecouvr
Created June 23, 2014 19:37
Show Gist options
  • Save trecouvr/7f26bd20c52026b1c6e0 to your computer and use it in GitHub Desktop.
Save trecouvr/7f26bd20c52026b1c6e0 to your computer and use it in GitHub Desktop.
spyne classmethod
class A(ServiceBase):
@rpc(String, _returns=String, _no_cls=False)
def hello(cls, ctx, name):
print(name, cls)
return cls._hello(name)
@classmethod
def _hello(cls, name):
return 'Hello, %s' % name
class B(A):
@classmethod
def _hello(cls, name):
return 'Bello, %s' % name
app = Application([B], name='Service', tns='my.ns.roxx', ..)
# client
client.service.hello('tom')
# >>> Bello, tom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment