+__doc__ = """
+ >>> flub(25)
+ 25
+ >>> g()
+ 0
+"""
+
cdef extern from "altet1.h":
ctypedef int blarg
print bobble
globvar = 0
+
+def g():
+ return globvar
+__doc__ = """
+ >>> test()
+ 1
+"""
+
cdef extern from "hinsen1.h":
ctypedef class spam.Spam [object PySpamObject]:
cdef class SpamAndEggs(Spam):
cdef cook(self):
- pass
+ return 1
+
+def test():
+ cdef SpamAndEggs s
+ s = SpamAndEggs()
+ return s.cook()
-cdef extern object g(int x) nogil
+cdef extern void g(int x) nogil
cdef void f(int x) nogil:
cdef int y
-def f(obj1, obj2):
+__doc__ = """
+ >>> f(20)
+ '20'
+ >>> f('test')
+ "'test'"
+
+ >>> g()
+ '42'
+"""
+
+def f(obj2):
obj1 = `obj2`
+ return obj1
+
+def g():
obj1 = `42`
-
\ No newline at end of file
+ return obj1
>>> f(1.0, 2.95)[0] == f(1.0, 2.95)[1]
True
- >>> constant_py()
- 1024L
+ >>> constant_py() == 2L ** 10
+ True
>>> constant_long() == 2L ** 36
True
+__doc__ = """
+ >>> f()
+"""
+
cdef struct Spam:
char *grail
-cdef void f():
+def f():
cdef int i, j, k
cdef char *p
i = sizeof(p)