[Cython] Feature Request: expand list/tuple in 'if (... in ...):' ...
Stefan Behnel
stefan_ml at behnel.de
Thu Jan 24 16:32:08 CET 2013
Christian Inci, 24.01.2013 16:19:
> On 01/24/2013 03:49 PM, Stefan Behnel wrote:
>> If you prefer keeping the set of integer values at a separate place, this
>> should work:
>
>> DEF INT_TUPLE = (0x66, 0x67, 0x2e,
>> 0x36, 0x3e, 0x26, 0x64,
>> 0x65, 0xf2, 0xf3, 0xf0)
>
>> (mind the upper case "DEF").
>
> According to 'http://docs.cython.org/src/userguide/language_basics.html#compile-time-definitions', this will only work using int, long, float or str.
Makes sense. It should be doable to make this work by copying AST nodes
around instead of their evaluated Python values. Doesn't sound all that
difficult.
Stefan
More information about the cython-devel
mailing list