Commit cf2ffbcc authored by Robert Bradshaw's avatar Robert Bradshaw

Cleanup.

parent c2e7b11e
......@@ -2875,7 +2875,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self.generate_base_type_import_code(env, entry, code)
self.generate_exttype_vtable_init_code(entry, code)
if entry.type.early_init:
self.generate_type_ready_code(entry, code)
self.generate_type_ready_code(entry, code)
def generate_base_type_import_code(self, env, entry, code):
base_type = entry.type.base_type
......
This diff is collapsed.
......@@ -3439,10 +3439,10 @@ def p_c_class_definition(s, pos, ctx):
if s.sy == '(':
positional_args, keyword_args = p_call_parse_args(s, allow_genexp=False)
if keyword_args:
s.error("C classes cannot take keyword bases.")
s.error("C classes cannot take keyword bases.")
bases, _ = p_call_build_packed_args(pos, positional_args, keyword_args)
if bases is None:
bases = ExprNodes.TupleNode(pos, args=[])
bases = ExprNodes.TupleNode(pos, args=[])
if s.sy == '[':
if ctx.visibility not in ('public', 'extern') and not ctx.api:
......
cdef class CBase(object):
cdef int a
cdef c_method(self):
return "CBase"
cpdef cpdef_method(self):
return "CBase"
cdef int a
cdef c_method(self):
return "CBase"
cpdef cpdef_method(self):
return "CBase"
class PyBase(object):
def py_method(self):
return "PyBase"
def py_method(self):
return "PyBase"
cdef class Both(CBase, PyBase):
cdef dict __dict__
"""
>>> b = Both()
>>> b.py_method()
'PyBase'
>>> b.cp_method()
'Both'
>>> b.call_c_method()
'Both'
cdef dict __dict__
"""
>>> b = Both()
>>> b.py_method()
'PyBase'
>>> b.cp_method()
'Both'
>>> b.call_c_method()
'Both'
>>> isinstance(b, CBase)
True
>>> isinstance(b, PyBase)
True
"""
cdef c_method(self):
return "Both"
cpdef cp_method(self):
return "Both"
def call_c_method(self):
return self.c_method()
>>> isinstance(b, CBase)
True
>>> isinstance(b, PyBase)
True
"""
cdef c_method(self):
return "Both"
cpdef cp_method(self):
return "Both"
def call_c_method(self):
return self.c_method()
cdef class BothSub(Both):
"""
>>> b = BothSub()
>>> b.py_method()
'PyBase'
>>> b.cp_method()
'Both'
>>> b.call_c_method()
'Both'
"""
pass
"""
>>> b = BothSub()
>>> b.py_method()
'PyBase'
>>> b.cp_method()
'Both'
>>> b.call_c_method()
'Both'
"""
pass
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