Commit 616ad557 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.28.x'

parents 45df4830 5fad0ae6
...@@ -40,9 +40,6 @@ Bugs fixed ...@@ -40,9 +40,6 @@ Bugs fixed
* Set iteration was broken in non-CPython since 0.28. * Set iteration was broken in non-CPython since 0.28.
* Overriding cpdef methods did not work in Python subclasses with slots.
(Github issue #1771)
* ``UnicodeEncodeError`` in Py2 when ``%s`` formatting is optimised for * ``UnicodeEncodeError`` in Py2 when ``%s`` formatting is optimised for
unicode strings. (Github issue #2276) unicode strings. (Github issue #2276)
......
...@@ -4338,9 +4338,7 @@ class OverrideCheckNode(StatNode): ...@@ -4338,9 +4338,7 @@ class OverrideCheckNode(StatNode):
if self.py_func.is_module_scope: if self.py_func.is_module_scope:
code.putln("else {") code.putln("else {")
else: else:
code.putln("else if (unlikely((Py_TYPE(%s)->tp_dictoffset != 0)" code.putln("else if (unlikely(Py_TYPE(%s)->tp_dictoffset != 0)) {" % self_arg)
" || (Py_TYPE(%s)->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {" % (
self_arg, self_arg))
func_node_temp = code.funcstate.allocate_temp(py_object_type, manage_ref=True) func_node_temp = code.funcstate.allocate_temp(py_object_type, manage_ref=True)
self.func_node.set_cname(func_node_temp) self.func_node.set_cname(func_node_temp)
# need to get attribute manually--scope would return cdef method # need to get attribute manually--scope would return cdef method
......
# mode: run
# tag: cpdef
# ticket: gh-1771
cdef class BaseType:
"""
>>> BaseType().callmeth()
BaseType.meth
"""
def callmeth(self):
return self.meth()
cpdef meth(self):
print("BaseType.meth")
class PyClass(BaseType):
"""
>>> PyClass().callmeth()
PyClass.meth
"""
def meth(self):
print("PyClass.meth")
class PySlotsClass(BaseType):
"""
>>> PySlotsClass().callmeth()
PySlotsClass.meth
"""
__slots__ = []
def meth(self):
print("PySlotsClass.meth")
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