Commit 1577cf89 authored by Stefan Behnel's avatar Stefan Behnel

Fix cpdef method test.

parent 618020b0
...@@ -35,22 +35,32 @@ class PyOverride(Ext): ...@@ -35,22 +35,32 @@ class PyOverride(Ext):
""" """
>>> p = PyOverride() >>> p = PyOverride()
>>> p.rec(10) >>> p.rec(10)
10
5
>>> p.rec(12)
12
11
10
5 5
>>> p.rec(11)
0
""" """
def rec(self, i): def rec(self, i):
return Ext.rec(self, i-1) if i > 10 else 5 print(i)
return Ext.rec(self, i) if i > 10 else 5
class SlotsOverride(Ext): class SlotsOverride(Ext):
""" """
>>> s = SlotsOverride() >>> s = SlotsOverride()
>>> s.rec(10) >>> s.rec(10)
10
6
>>> s.rec(12)
12
11
10
6 6
>>> s.rec(11)
0
""" """
__slots__ = () __slots__ = ()
def rec(self, i): def rec(self, i):
return Ext.rec(self, i-1) if i > 10 else 6 print(i)
return Ext.rec(self, i) if i > 10 else 6
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