[Cython] [Python-Dev] C-level duck typing  Stefan Behnel
stefan_ml at behnel.de Thu May 17 12:03:34 CEST 2012  mark
florisson, 17.05.2012 11:15: > On 17 May 2012 07:09, Stefan
Behnel <stefan_ml at behnel.de> wrote: >> mark florisson,
16.05.2012 21:49: >>> On 16 May 2012 20:15, Stefan Behnel
<stefan_ml at behnel.de> wrote: >>>> "Martin v. Löwis",
16.05.2012 20:33: >>>>>> Does this use case make sense to
everyone? >>>>>> The reason why we are discussing this on
python-dev is that we are looking >>>>>> for a general way to
expose these C level signatures within the Python >>>>>>
ecosystem. And Dag's idea was to expose them as part of the type
object, >>>>>> basically as an addition to the current Python
level tp_call() slot. >>>>> The use case makes sense, yet there
is also a long-standing solution >>>>> already to expose APIs
and function pointers: the capsule objects. >>>>> If you want to
avoid dictionary lookups on the server side, implement >>>>>
tp_getattro, comparing addresses of interned strings. >>>> I t