=== modified file 'Doc/library/multiprocessing.rst' --- Doc/library/multiprocessing.rst 2008-06-26 08:45:27 +0000 +++ Doc/library/multiprocessing.rst 2008-06-26 09:49:23 +0000 @@ -891,7 +891,7 @@ It is possible to create shared objects using shared memory which can be inherited by child processes. -.. function:: Value(typecode_or_type[, lock[, *args]]) +.. function:: Value(typecode_or_type, *args, lock=None) Return a :mod:`ctypes` object allocated from shared memory. By default the return value is actually a synchronized wrapper for the object. @@ -900,16 +900,14 @@ ctypes type or a one character typecode of the kind used by the :mod:`array` module. *\*args* is passed on to the constructor for the type. - If *lock* is ``True`` (the default) then a new lock object is created to + If *lock* is ``None`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or :class:`RLock` object then that will be used to synchronize access to the - value. If *lock* is ``False`` then access to the returned object will not be - automatically protected by a lock, so it will not necessarily be - "process-safe". + value. Note that *lock* is a keyword-only argument. -.. function:: Array(typecode_or_type, size_or_initializer, *, lock=True) +.. function:: Array(typecode_or_type, size_or_initializer, lock=None) Return a ctypes array allocated from shared memory. By default the return value is actually a synchronized wrapper for the array. @@ -921,14 +919,10 @@ 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 + If *lock* is ``None`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or :class:`RLock` object then that will be used to synchronize access to the - value. If *lock* is ``False`` then access to the returned object will not be - automatically protected by a lock, so it will not necessarily be - "process-safe". - - Note that *lock* is a keyword only argument. + value. Note that an array of :data:`ctypes.c_char` has *value* and *rawvalue* attributes which allow one to use it to store and retrieve strings. @@ -983,33 +977,27 @@ attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`. -.. function:: Array(typecode_or_type, size_or_initializer[, lock[, *args]]) +.. function:: Array(typecode_or_type, size_or_initializer, lock=None) The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes array. - If *lock* is ``True`` (the default) then a new lock object is created to + If *lock* is ``None`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or :class:`RLock` object then that will be used to synchronize access to the - value. If *lock* is ``False`` then access to the returned object will not be - automatically protected by a lock, so it will not necessarily be - "process-safe". - - Note that *lock* is a keyword-only argument. - -.. function:: Value(typecode_or_type, *args[, lock]) + value. + +.. function:: Value(typecode_or_type, *args, lock=None) The same as :func:`RawValue` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes object. - If *lock* is ``True`` (the default) then a new lock object is created to + If *lock* is ``None`` (the default) then a new lock object is created to synchronize access to the value. If *lock* is a :class:`Lock` or :class:`RLock` object then that will be used to synchronize access to the - value. If *lock* is ``False`` then access to the returned object will not be - automatically protected by a lock, so it will not necessarily be - "process-safe". + value. Note that *lock* is a keyword-only argument. === modified file 'Lib/multiprocessing/__init__.py' --- Lib/multiprocessing/__init__.py 2008-06-25 13:37:51 +0000 +++ Lib/multiprocessing/__init__.py 2008-06-26 09:26:08 +0000 @@ -245,12 +245,12 @@ from multiprocessing.sharedctypes import Value return Value(typecode_or_type, *args, **kwds) -def Array(typecode_or_type, size_or_initializer, **kwds): +def Array(typecode_or_type, size_or_initializer, lock=None): ''' Returns a synchronized shared array ''' from multiprocessing.sharedctypes import Array - return Array(typecode_or_type, size_or_initializer, **kwds) + return Array(typecode_or_type, size_or_initializer, lock) # # === modified file 'Lib/multiprocessing/sharedctypes.py' --- Lib/multiprocessing/sharedctypes.py 2008-06-25 13:37:51 +0000 +++ Lib/multiprocessing/sharedctypes.py 2008-06-26 09:36:50 +0000 @@ -75,13 +75,10 @@ assert hasattr(lock, 'acquire') return synchronized(obj, lock) -def Array(typecode_or_type, size_or_initializer, **kwds): +def Array(typecode_or_type, size_or_initializer, lock=None): ''' Return a synchronization wrapper for a RawArray ''' - lock = kwds.pop('lock', None) - if kwds: - raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys())) obj = RawArray(typecode_or_type, size_or_initializer) if lock is None: lock = RLock() === modified file 'Modules/_ctypes/libffi/configure' (properties changed: -x to +x) === modified file 'configure' (properties changed: -x to +x)