Use Python 3.x-style keyword only arg in Array()

Previously a Python 2.x compatible hack was used for
multiprocessing.sharedctypes.Array().  Also the documented
signature was wrong.
This commit is contained in:
Richard Oudkerk 2012-05-29 12:01:47 +01:00
parent 1074a9294b
commit 87ea780e8e
3 changed files with 9 additions and 12 deletions

View file

@ -228,19 +228,19 @@ def RawArray(typecode_or_type, size_or_initializer):
from multiprocessing.sharedctypes import RawArray
return RawArray(typecode_or_type, size_or_initializer)
def Value(typecode_or_type, *args, **kwds):
def Value(typecode_or_type, *args, lock=True):
'''
Returns a synchronized shared object
'''
from multiprocessing.sharedctypes import Value
return Value(typecode_or_type, *args, **kwds)
return Value(typecode_or_type, *args, lock=lock)
def Array(typecode_or_type, size_or_initializer, **kwds):
def Array(typecode_or_type, size_or_initializer, *, lock=True):
'''
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=lock)
#
#