dropbox/pyston — pull request #107 by tjhance (2014-07-23 10:53:57+00:00)
Title: add unbound instancemethods

Right now class methods are stored as plain functions, and bound instancemethods are created for instances of the class. Instead the methods should be stored in the class as *unbound instancemethods*. I added support for these and modify the object model so that getting or calling an attribute of an instance will do the object-binding for unbound instancemethods, not for functions. (In particular, functions (like staticmethods) that are members of a class should *not* get bound to an object.) I also modified the methods of the all the built-in types to be unbound instancemethods. (Some of these should actually be more exotic python types, e.g. `int.__add__` should be a `wrapper_descriptor`, whatever that is, but until we support those, an unbound instancemethod seems most natural to facilitate the binding.)

Unfortunately this does result in an extra layer of indirection for making the call (and in fact, I had to slightly bump the `slowpath_callattr` limit for a test case); on the other hand, I think we can optimize this away.