[Python-Dev] why is _PyBytes_Join not public but PyUnicode_Join is?

MRAB python at mrabarnett.plus.com
Fri Aug 31 04:48:59 CEST 2012


On 31/08/2012 02:43, Gregory P. Smith wrote:
> We have use for _PyBytes_Join in an extension module but technically it
> isn't a public Python C API... anyone know why?
>
> PyUnicode_Join is.
>
> Looking up the bytes 'join' method and using the C API to call that
> method object with proper parameters seems like overkill in the case
> where we're not dealing with user supplied byte strings at all.
>
For what it's worth, I could also make use of it in the regex module.

I use PyUnicode_Join when working with Unicode strings, but I could also
use PyBytes_Join if it were available instead of having to look it up.


More information about the Python-Dev mailing list