From: Stefan Behnel Date: Sat, 15 Sep 2007 10:39:56 +0000 (+0200) Subject: [has|get|set]attr() optimisation X-Git-Tag: 0.9.6.14~29^2~129^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c47a68ab3694b02c5fc8a6dc0f9ad95fdcac5924;p=cython.git [has|get|set]attr() optimisation --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 7daeb4e4..18720d10 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -513,7 +513,9 @@ class BuiltinScope(Scope): # TODO: perhapse these should all be declared in some universal .pxi file? builtin_functions = { - "hasattr": ["PyObject_HasAttrString", c_bint_type, (py_object_type, c_char_ptr_type)], + "hasattr": ["PyObject_HasAttr", c_bint_type, (py_object_type, py_object_type)], + "getattr": ["PyObject_GetAttr", py_object_type, (py_object_type, py_object_type)], + "setattr": ["PyObject_SetAttr", c_bint_type, (py_object_type, py_object_type), -1], "cmp": ["PyObject_Compare", c_int_type, (py_object_type, py_object_type), None, True], "repr": ["PyObject_Repr", py_object_type, (py_object_type, ), 0], # "str": ["PyObject_Str", py_object_type, (py_object_type, ), 0],