numba icon indicating copy to clipboard operation
numba copied to clipboard

pythonapi function for PyBytes_AsStringAndSize?

Open jpivarski opened this issue 2 years ago • 2 comments

It looks like pythonapi.py doesn't have a function for PyBytes_AsStringAndSize (or PyBytes_AsString or PyBytes_Size, for that matter).

We could implement it manually, following an example like

https://github.com/numba/numba/blob/60723cb5a31d0b6ef516af95602a463322991420/numba/core/pythonapi.py#L470-L475

But are there any plans to fill out this part of the PythonAPI class with these methods?

Thanks!

Cc: @ianna

jpivarski avatar Sep 21 '22 15:09 jpivarski

No plans, but I know some of these were driven by requests, so I'll check if there's any reason we didn't.

apmasell avatar Sep 21 '22 15:09 apmasell

There wasn't a reason we needed it, so we didn't bother. We can add it or if you want to create a PR because you have the code for it, that works too.

apmasell avatar Sep 21 '22 20:09 apmasell

I'd be happy to create a PR for it. Thanks!

ianna avatar Sep 23 '22 09:09 ianna

Closing as implemented in #8462 with thanks to @ianna!

stuartarchibald avatar Apr 27 '23 21:04 stuartarchibald