[Python-Dev] Re: Change module attribute get & set

Neil Schemenauer nas@python.ca
Fri, 11 May 2001 07:06:39 -0700


noreply@sourceforge.net wrote:
> Module objects currently don't define the tp_getattro 
> or tp_setattro slots.  As a result, interning of 
> attribute names does them no good:  a char* is always 
> passed, so the dict lookup always needs to do a string 
> compare despite that the attribute name is interned.

I think this is a problem in classobject.c:generic_binary_op as
well.  PyObject_GetAttrString is always used.  I believe the old
code interned names like "__add__" and used PyObject_GetAttr.  Is
it worth fixing this?

  Neil