Commit aa77044b authored by Robert Bradshaw's avatar Robert Bradshaw

Allow a cpdef function to override a cdef function

(But not the other way around...)
parent 9fa7ce41
...@@ -627,7 +627,7 @@ class CFuncType(CType): ...@@ -627,7 +627,7 @@ class CFuncType(CType):
return 1 return 1
if not other_type.is_cfunction: if not other_type.is_cfunction:
return 0 return 0
if self.is_overridable != other_type.is_overridable: if not self.is_overridable and other_type.is_overridable:
return 0 return 0
nargs = len(self.args) nargs = len(self.args)
if nargs <> len(other_type.args): if nargs <> len(other_type.args):
...@@ -660,7 +660,7 @@ class CFuncType(CType): ...@@ -660,7 +660,7 @@ class CFuncType(CType):
return 1 return 1
if not other_type.is_cfunction: if not other_type.is_cfunction:
return 0 return 0
if self.is_overridable != other_type.is_overridable: if not self.is_overridable and other_type.is_overridable:
return 0 return 0
nargs = len(self.args) nargs = len(self.args)
if nargs - self.optional_arg_count != len(other_type.args) - other_type.optional_arg_count: if nargs - self.optional_arg_count != len(other_type.args) - other_type.optional_arg_count:
......
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