[PATCH 7 of 7] rust-cpython: leverage upstreamed py_capsule_fn!() macro

Georges Racinet georges.racinet at octobus.net
Sun Oct 13 09:25:45 EDT 2019


On 10/13/19 2:37 PM, Yuya Nishihara wrote:
> On Sun, 13 Oct 2019 14:08:24 +0200, Georges Racinet wrote:
>>> +py_capsule_fn!(
>>> +    from mercurial.cext.parsers import index_get_parents_CAPI
>>> +        as get_parents_capi
>>> +        signature (
>>> +            index: *mut python_sys::PyObject,
>> Here you can directly use RawPyObject:
>>
>>    index: *mut RawPyObject,
>>
>> see
>> https://github.com/dgrunwald/rust-cpython/commit/c5cfd32cf05005e3ad515063c9ca14100362eb93
> Oh, there is. I was looking for cpython::RawPyObject and failed.
That's actually how my first attempt looked like IIRC, but Mark
preferred it to be enclosed in the capsule submodule to limit that
abstraction leak to cases where it's really needed.
>
> I'll send V2 shortly.

Cool, once it's landed, I'll send the remainders of my own series:
removal of `py_set()` in favour of `cpython::objects::PySet`.

Regards,

-- 
Georges Racinet
https://octobus.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20191013/528adc71/attachment.sig>


More information about the Mercurial-devel mailing list