Accessing __slots__ from C
Chris
ceball at users.sourceforge.net
Thu Sep 11 16:12:52 EDT 2008
Hrvoje Niksic <hniksic <at> xemacs.org> writes:
...
> [ You can use the capi-sig for questions like this; see
> http://mail.python.org/mailman/listinfo/capi-sig ]
Thanks, I had no idea about that.
> PyObject_GetAttrString is convenient, but it creates a Python string
> only so it can intern it (and in most cases throw away the freshly
> created version). For maximum efficiency, pre-create the string
> object using PyString_InternFromString, and use that with
> PyObject_GetAttr.
Yes, we'd thought of that too, but it doesn't seem to be an important
factor compared to the actual attribute lookup.
Thanks for the advice,
Chris
More information about the Python-list
mailing list