~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/python/functor/runme.py

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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