[Python-Dev] CALL_ATTR patch (was: 2.3b1 release)

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 18 Apr 2003 14:15:11 +1200 (NZST)


> In earlier versions, functions were special-cased by the instance
> getattr code; the special case has been subsumed by looking for a
> __get__ method.  Yes, this means that a plain Python function object
> is a descriptor!

While we're on the topic -- Guid, how would you feel about the
idea of giving built-in function objects the same instance-
binding behaviour as interpreted functions?

This would help Pyrex considerably, because currently I
have to resort to a kludge to make Pyrex-defined functions
work as methods. It mostly works, but it has some side
effects, such as breaking the most common idiomatic
usage of staticmethod() and classmethod().

If built-in functions were more like interpreted functions
in this regard, all these problems would go away.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+