On Tue, Aug 17, 2010 at 7:43 PM, Lisandro Dalcin <[email protected]> wrote:
> I'm working on a patch trying to (you know me!)  silent GCC unused
> warnings for special methods like __idiv__/__div__ that get generated
> but not used under a Py 3 runtime...

Yay.

> In the process, I would like to
> make a little cleanup in TypeSlots.py... One of these cleanups, is
> related to the 'flag' argument to SlotDescriptor.__init__() ..
> Currently, it's only usage is to conditionally fill the nb_index slot.
>
> In short, instead of defining the slot as:
>
>    MethodSlot(unaryfunc, "nb_index", "__index__", flag =
> "Py_TPFLAGS_HAVE_INDEX")
>
> I'll do it like this:
>
>    MethodSlot(unaryfunc, "nb_index", "__index__", ifdef =
> ""PY_VERSION_HEX >= 0x02050000"")
>
>
> Comments ?

I think Py_TPFLAGS_HAVE_INDEX is more explicit, so I prefer that, but
can't you use the latter form when there isn't already a flag? That's
orthogonal to the name, which I could go either way on.

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

Reply via email to