]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.8] bpo-43087: Fix error in ctypes "Incomplete Types" doc (GH-24404)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 8 Apr 2021 08:22:00 +0000 (01:22 -0700)
committerGitHub <noreply@github.com>
Thu, 8 Apr 2021 08:22:00 +0000 (04:22 -0400)
The previous "Fundamental data types" section says a c_char_p must be bytes (or None).
(cherry picked from commit 14829b09eb652f457cf837836909169746a810f0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Doc/library/ctypes.rst

index 7313148721dac60cc49cc70218f13e80871b9367..fd6422cc8c06c5f38ba6379d49154f575ee7d30f 100644 (file)
@@ -919,9 +919,9 @@ Let's try it. We create two instances of ``cell``, and let them point to each
 other, and finally follow the pointer chain a few times::
 
    >>> c1 = cell()
-   >>> c1.name = "foo"
+   >>> c1.name = b"foo"
    >>> c2 = cell()
-   >>> c2.name = "bar"
+   >>> c2.name = b"bar"
    >>> c1.next = pointer(c2)
    >>> c2.next = pointer(c1)
    >>> p = c1