numba/numba — pull request #169 by wwoods (2013-03-20 02:39:37+00:00)
Title: Allowing decorators (@autojit) to be bound as instance methods

Without this pull, the following does not work:

class A(object):
@autojit
def a(self, c):
return c
A().a()

It does not work because the NumbaWrapper is not a descriptor, and misses the binding cue.

Note that I did not add any tests, as I am having issues getting them to run; I would be happy to add some to this pull request with some help getting them to run:

(ipython)walt@mrrobot:~/pycon/ipython/numba$ ./runtests.py
Traceback (most recent call last):
File "./runtests.py", line 6, in
import numba
File "/home/walt/pycon/ipython/numba/numba/__init__.py", line 15, in
from numba import utils, typesystem
File "/home/walt/pycon/ipython/numba/numba/utils.py", line 11, in
from numba.typesystem.typemapper import NumbaTypeMapper
File "/home/walt/pycon/ipython/numba/numba/typesystem/__init__.py", line 9, in
from .typemapper import *
File "/home/walt/pycon/ipython/numba/numba/typesystem/typemapper.py", line 18, in
from numba import numbawrapper
ImportError: cannot import name numbawrapper
(ipython)walt@mrrobot:~/pycon/ipython/numba$