[Python-3000] Binding builtin function to class

Alex Martelli aleaxit at gmail.com
Mon Apr 28 16:14:10 CEST 2008


On Mon, Apr 28, 2008 at 4:14 AM, Haoyu Bai <divinekid at gmail.com> wrote:
   ...
>  Yes, these are the very problems I encountered. I think the using of
> "new.instancemethod" is for speed, because in SWIG's command line, the
> "-fastproxy" option enabled it:
>
>  -fastproxy      - Use fast proxy mechanism for member methods
>
>  So what we expect is to find a way doing this in Python 3, as fast as the
> "new.instancemethod".

Essentially a descriptor type with a suitable __get__, right?  And
C-coded if it needs to be that fast. Is this a SWIG-specific issue (so
that SWIG can take care of it in the C code it generates or links) or
sufficiently general to warrant an addition to the Python core?
Instinctively I think the latter, but can't easily think of another
usecase beyond SWIG (and perhaps similar tools such as Boost or SIP).


Alex


More information about the Python-3000 mailing list