summaryrefslogtreecommitdiff
path: root/Examples/python/functor/runme.py
blob: 7f6f2b649bcabc3de926247c6f907371fc87845a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Operator overloading example
import example
import math

a = example.intSum(0)
b = example.doubleSum(100.0)

# Use the objects.  They should be callable just like a normal
# python function.

for i in range(0, 100):
    a(i)                # Note: function call
    b(math.sqrt(i))     # Note: function call

print a.result()
print b.result()