# Ctypes page doctest typo?

**URL:** <https://discuss.python.org/t/ctypes-page-doctest-typo/25138>\
**Category:** Documentation\
**Created:** [March 24, 2023, 2:04pm UTC](https://discuss.python.org/t/ctypes-page-doctest-typo/25138 "2023-03-24T14:04:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterjpxie](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/peterjpxie/32/10741_2.png) [@peterjpxie](https://discuss.python.org/u/peterjpxie)\
**Post date:** [March 24, 2023, 2:04pm UTC](https://discuss.python.org/t/ctypes-page-doctest-typo/25138/1 "2023-03-24T14:04:57Z")

</div>

Is the doctest highlighted just a typo?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/2X/8/80f694ee5b5347dbe287301bb341b5f213557b43.png)

source code:

```auto
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")

```

---

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [March 24, 2023, 2:13pm UTC](https://discuss.python.org/t/ctypes-page-doctest-typo/25138/2 "2023-03-24T14:13:06Z")

</div>

> [@peterjpxie](#):
>
> ```rst
> single character Python bytes object into a C char::
> ^^
> .. doctest::
> 
> ```

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.

```rst
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!

---

<div class="post-metadata">

**Author:** ![peterjpxie](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/peterjpxie/32/10741_2.png) [@peterjpxie](https://discuss.python.org/u/peterjpxie)\
**Post date:** [March 25, 2023, 4:32am UTC](https://discuss.python.org/t/ctypes-page-doctest-typo/25138/3 "2023-03-25T04:32:50Z")

</div>

Thanks, will do when I have time in coming days.
