I want to return a instance of user defined class and list of instances of user defined class from a ladon function? Is it possible?
Asked
Active
Viewed 125 times
1 Answers
0
this might help you its something like this
from ladon.ladonizer import ladonize
from ladon.types.ladontype import LadonType
class Response(LadonType):
values = [int]
class MyService(object):
@ladonize(int, int, rtype=Response)
def foo(self, a, b):
result = Response()
result.values = [a+b, a*b]
return result

NullPoiиteя
- 56,591
- 22
- 125
- 143
-
Suppose from my program 'PG1', we are calling a ladonize function. From the ladonize function it will call a function in another module, for eg: Module1. From 'Module1', it returns one instance of class A and list of another instances of class B. Both A and B are user defined. Then from the ladonized function, I want to return both instances into my program 'PG1'. – user1059150 Oct 13 '12 at 09:20