import source from 1.3.40
[external/swig.git] / Examples / python / functor / runme.py
1 # Operator overloading example
2 import example
3 import math
4
5 a = example.intSum(0)
6 b = example.doubleSum(100.0)
7
8 # Use the objects.  They should be callable just like a normal
9 # python function.
10
11 for i in range(0,100):
12     a(i)                # Note: function call
13     b(math.sqrt(i))     # Note: function call
14
15 print a.result()
16 print b.result()
17