Robert Bradshaw, 07.01.2010 09:54:
> On Jan 6, 2010, at 11:18 AM, Dag Sverre Seljebotn wrote:
>> Stefan Behnel wrote:
>>> I think it would be nice to support 'cdef inline' methods in  
>>> extension types and let Cython call them without the normal method
>>> indirection, e.g.
>>>
>>> cdef class MyType:
>>>     cdef list large_list
>>>     cdef size_t y
>>>
>>>     cdef big_method(self):
>>>         for x in self.large_list:
>>>             self.small_method(x)
>>>
>>>     cdef inline small_method(self, x):
>>>         self.y += x
>>>
>>> would emit a direct call to the ..._small_method(self, x) C function
>>> in big_method(), instead of passing through self->__pyx_vtab->small_method.
>>> This would require these methods to be non-overridable, which I  
>>> think makes sense for something declared 'inline'.
>>>
>> I remember wanting this feature when I first saw Cython (then never  
>> got around to it). So very much +1 on the feature, not sure about syntax.
> 
> This has been floating around in the back of my head as well, so +1.

http://trac.cython.org/cython_trac/ticket/474

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to