[Cython] Another type idea

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Mon Mar 10 23:26:00 CET 2008


Getting ideas after posting...

One could also declare known return type of existing ptyhon lib functions like this:

assumetype(cython.types.int, sum)

def foo(arr):
  s = sum(arr)
  # s is now  native C int

leading to eliminating all the casts.

Dag Sverre Seljebotn



More information about the Cython-dev mailing list