From: Stefan Behnel Date: Sun, 13 Oct 2013 18:44:49 +0000 (+0200) Subject: avoid unnecessary overhead when setting Python class docstrings X-Git-Tag: 0.20b1~289^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59056f62619cfe81486a5889b419d5de00b35089;p=platform%2Fupstream%2Fpython-cython.git avoid unnecessary overhead when setting Python class docstrings --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 6a74f6c..d95ca8b 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -6680,8 +6680,10 @@ class ClassNode(ExprNode, ModuleNameMixin): if self.doc: code.put_error_if_neg(self.pos, - 'PyDict_SetItemString(%s, "__doc__", %s)' % ( + 'PyDict_SetItem(%s, %s, %s)' % ( self.dict.py_result(), + code.intern_identifier( + StringEncoding.EncodedString("__doc__")), self.doc.py_result())) py_mod_name = self.get_py_mod_name(code) qualname = self.get_py_qualified_name(code)