TypeError while representing arbitrary element type in multiprocessing.Array
Question: 
    >>> from multiprocessing import Array, Value
    >>> import numpy as np
    >>> a = [(i,[]) for i in range(3)]
    >>> a
    [(0, []), (1, []), (2, [])]
    >>> a[0][1].extend(np.array([1,2,3]))
    >>> a[1][1].extend(np.array([4,5]))
    >>> a[2][1].extend(np.array([6,7,8]))
    >>> a
    [(0, [1, 2, 3]), (1, [4, 5]), (2, [6, 7, 8])]
    

Following the python multiprocessing [example: def
test_sharedvalues():](http://docs.python.org/2/library/multiprocessing.html) I
am trying to create a shared Proxy object using the below code:

    
    
    shared_a = [multiprocessing.Array(id, e) for id, e in a]
    

but it is giving me an error

    
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib64/python2.6/multiprocessing/__init__.py", line 255, in Array
        return Array(typecode_or_type, size_or_initializer, **kwds)
      File "/usr/lib64/python2.6/multiprocessing/sharedctypes.py", line 87, in Array
        obj = RawArray(typecode_or_type, size_or_initializer)
      File "/usr/lib64/python2.6/multiprocessing/sharedctypes.py", line 60, in RawArray
        result = _new_value(type_)
      File "/usr/lib64/python2.6/multiprocessing/sharedctypes.py", line 36, in _new_value
        size = ctypes.sizeof(type_)
    TypeError: this type has no size
    


Answer: Ok. The problem is solved

I changed

    
    
    >>> a = [(i,[]) for i in range(3)]
    

to

    
    
    >>> a = [('i',[]) for i in range(3)]
    

and this solved the TypeError.

Actually, I also found out that I did not necessarily had to use the i as
count within range(3) (since Array automatically allows indexing), The 'i' is
for c_int typecode under multiprocessing.sharedctypes

Hope this helps.

