From: Robert Bradshaw Date: Sat, 2 Nov 2013 03:31:38 +0000 (-0700) Subject: Clear tp_print for cdef classes. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31890343f048e58ebe7986cf56d6fbdeaf7c16b7;p=platform%2Fupstream%2Fpython-cython.git Clear tp_print for cdef classes. --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 88e6ae0..49b61e0 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -2514,6 +2514,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): "if (PyType_Ready(&%s) < 0) %s" % ( typeobj_cname, code.error_goto(entry.pos))) + # Don't inherit tp_dict from builting types, restoring the + # behavior of using tp_repr or tp_str instead. + code.putln("%s.tp_print = 0;" % typeobj_cname) # Fix special method docstrings. This is a bit of a hack, but # unless we let PyType_Ready create the slot wrappers we have # a significant performance hit. (See trac #561.)