[Cython] Done with compiler options/pragmas
Carl Witty
cwitty at newtonlabs.com
Tue Aug 5 19:03:53 CEST 2008
On Tue, Aug 5, 2008 at 8:34 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Dag Sverre Seljebotn wrote:
>> There is
>> not really such symbol as cython.boundscheck in the scope, it is a magic
>> option only. So of course you cannot do
>>
>> a = cython.boundscheck
>> @a
>> ...
>
> Fine with me.
Hopefully this will fail at compile-time rather than runtime?
>> d) A with statement:
>>
>> cimport cython
>> with cython.boundscheck(False):
>> ...
>>
>> The entire with statement is then stripped out of the source prior to
>> the with transformation.
>
> Fine. We should take a little care that we document directives that cannot
> be used that way, e.g. because they only apply to functions and not to
> simple blocks (not sure we ever need that, just a side-note).
Again, such directives should fail at compile-time. (The restriction
should be documented, too, of course.)
Carl
More information about the Cython-dev
mailing list