Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/python/functor/runme.py
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06:00

17 lines
345 B
Python

# 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()