mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
#7814: fix wrong example function usage.
This commit is contained in:
parent
ea30c6f5ee
commit
167543c701
1 changed files with 5 additions and 4 deletions
|
@ -136,10 +136,10 @@ Server code::
|
|||
server.register_function(adder_function, 'add')
|
||||
|
||||
# Register an instance; all the methods of the instance are
|
||||
# published as XML-RPC methods (in this case, just 'div').
|
||||
# published as XML-RPC methods (in this case, just 'mul').
|
||||
class MyFuncs:
|
||||
def div(self, x, y):
|
||||
return x // y
|
||||
def mul(self, x, y):
|
||||
return x * y
|
||||
|
||||
server.register_instance(MyFuncs())
|
||||
|
||||
|
@ -209,7 +209,8 @@ requests sent to Python CGI scripts.
|
|||
Example::
|
||||
|
||||
class MyFuncs:
|
||||
def div(self, x, y) : return x // y
|
||||
def mul(self, x, y):
|
||||
return x * y
|
||||
|
||||
|
||||
handler = CGIXMLRPCRequestHandler()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue