Commit cf42b0a0 authored by Stefan Behnel's avatar Stefan Behnel

clean up test a little

--HG--
extra : rebase_source : 7b763fbb0f2485056ec4d2f53a5ec76dc7be9203
parent 80a05e8f
# mode: run
cdef class Spam:
cdef int tons
cdef void add_tons(self, int x):
self.tons = self.tons + x
self.tons += x
cdef void eat(self):
self.tons = 0
......@@ -11,10 +13,10 @@ cdef class Spam:
def lift(self):
print self.tons
cdef class SuperSpam(Spam):
cdef class SubSpam(Spam):
cdef void add_tons(self, int x):
self.tons = self.tons + 2 * x
self.tons += 2 * x
def test():
"""
......@@ -25,13 +27,13 @@ def test():
5
"""
cdef Spam s
cdef SuperSpam ss
cdef SubSpam ss
s = Spam()
s.eat()
s.add_tons(5)
s.lift()
ss = SuperSpam()
ss = SubSpam()
ss.eat()
ss.lift()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment