Stefan wrote:
> Hi,
>
> I missed the end of this discussion, but here is a comment anyway.
>
> Dag Sverre Seljebotn wrote:
>> Robert Bradshaw wrote:
>>> I think we should follow a similar format as in PEP 0263.
>
> I do not think that PEP 263 provides a suitable example here, as the
> syntax
> was specifically chosen as the lowest common divisor of a number of
> existing
> encoding hints for different editors, each of which has an explicit syntax
> that isn't quite compatible with any other syntax.
>
>
>>> Specifically, I'm not even sure the "cython" is necessary--the
>>> compiler directives are arbitrary key-value pairs, and they are
>>> looked up as needed. The ones that Cython uses/supports will be
>>> documented.
>>
>> You can now do
>>
>> # boundscheck = True
>> # boundscheck = False
>
> The problem with this is that users who are not aware of directives can
> end up
> breaking their code by commenting out an assignment. Even if that's
> unlikely,
> it is not immediately clear from the syntax that it is /not/ just an
> assignment that was removed from the code by commenting it out, but
> something
> that actually changes the way things work. A compiler directive should be
> clearly recognisable as such, especially when it invades the privacy of
> the
> user's comments.

Yes, and this is now reverted in -devel; you have to use a cython: prefix.

I just remembered (I had forgot) that my stance was to do
"boundscheck(True)" instead in order to become consistent with the
decorators and with statements, so that there is only one syntax within
pyx files. But it is too late to do that now I think (at least for this
release; and supporting both is not a problem).

Dag Sverre

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

Reply via email to