[Python-ideas] A General Outline for Just-in-Time Acceleration of Python

Stefan Behnel stefan_ml at behnel.de
Mon Jun 16 09:34:30 CEST 2014


Chris Angelico, 16.06.2014 09:15:
> On Mon, Jun 16, 2014 at 5:05 PM, Stefan Behnel wrote:
>> You can rewrite this as
>>
>>      import cython
>>
>>      @cython.locals(n=int, i=int)
>>      def silly():
>>
>> which makes it valid Python but has the same semantics as your cdef
>> declaration when compiled in Cython.
> 
> Syntactically valid, yes. Is there a dummy decorator class
> cython.locals for the case where it's running under Python?

Wouldn't make much sense otherwise, would it? :)

https://github.com/cython/cython/blob/master/Cython/Shadow.py

Here are some details:

http://docs.cython.org/src/tutorial/pure.html

Stefan




More information about the Python-ideas mailing list