From 362b57a031a1bce8ae659e0515b6edb7935447b2 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Sun, 13 Apr 2025 18:55:32 +0200 Subject: [PATCH 1/3] Document the `c` typecode for `multiprocessing.Array`. --- Doc/library/multiprocessing.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 6ccc0d4aa59555..d44b3ffacc4763 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1559,11 +1559,13 @@ inherited by child processes. value is actually a synchronized wrapper for the array. *typecode_or_type* determines the type of the elements of the returned array: - it is either a ctypes type or a one character typecode of the kind used by - the :mod:`array` module. If *size_or_initializer* is an integer, then it - determines the length of the array, and the array will be initially zeroed. - Otherwise, *size_or_initializer* is a sequence which is used to initialize - the array and whose length determines the length of the array. + it is either a :ref:`ctypes type ` or a one + character typecode of the kind used by the :mod:`array` module. In addition, + the ``c`` typecode is an alias for :class:`ctypes.c_char`. If + *size_or_initializer* is an integer, then it determines the length of the + array, and the array will be initially zeroed. Otherwise, + *size_or_initializer* is a sequence which is used to initialize the array + and whose length determines the length of the array. If *lock* is ``True`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or From d9fad5be9a985bb958c487f590126aa3cdbbd7c7 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 14 Apr 2025 20:27:55 +0200 Subject: [PATCH 2/3] Add quotes --- Doc/library/multiprocessing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index d44b3ffacc4763..6f3965dfd47dcb 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1561,7 +1561,7 @@ inherited by child processes. *typecode_or_type* determines the type of the elements of the returned array: it is either a :ref:`ctypes type ` or a one character typecode of the kind used by the :mod:`array` module. In addition, - the ``c`` typecode is an alias for :class:`ctypes.c_char`. If + the ``'c'`` typecode is an alias for :class:`ctypes.c_char`. If *size_or_initializer* is an integer, then it determines the length of the array, and the array will be initially zeroed. Otherwise, *size_or_initializer* is a sequence which is used to initialize the array From e23c86d85998efba272f6a07780c3408a2884846 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 14 Apr 2025 20:30:04 +0200 Subject: [PATCH 3/3] Mention that 'w' is not supported --- Doc/library/multiprocessing.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 6f3965dfd47dcb..d1816a45371e4d 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1560,12 +1560,13 @@ inherited by child processes. *typecode_or_type* determines the type of the elements of the returned array: it is either a :ref:`ctypes type ` or a one - character typecode of the kind used by the :mod:`array` module. In addition, - the ``'c'`` typecode is an alias for :class:`ctypes.c_char`. If - *size_or_initializer* is an integer, then it determines the length of the - array, and the array will be initially zeroed. Otherwise, - *size_or_initializer* is a sequence which is used to initialize the array - and whose length determines the length of the array. + character typecode of the kind used by the :mod:`array` module with the + exception of ``'w'``, which is not supported. In addition, the ``'c'`` + typecode is an alias for :class:`ctypes.c_char`. If *size_or_initializer* + is an integer, then it determines the length of the array, and the array + will be initially zeroed. Otherwise, *size_or_initializer* is a sequence + which is used to initialize the array and whose length determines the length + of the array. If *lock* is ``True`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or