If you want to avoid the ``ord("x")`` calls above, you can set the
:attr:`argtypes` attribute, and the second argument will be converted from a
single character Python bytes object into a C char::
.. doctest::
>>> strchr.restype = c_char_p
>>> strchr.argtypes = [c_char_p, c_char]
>>> strchr(b"abcdef", b"d")
b'def'
>>> strchr(b"abcdef", b"def")
The problem appears to be that there is both double colon which makes the following a code block, but then a doctest directive is also used. Presumably, the :: was left in accidentally after convrting to a doctest and should be removed, i.e.
single character Python bytes object into a C char:
.. doctest::
Would you like to submit a PR to fix it? You can @ me for review. Thanks!