While resizing an object by script: 'tuple' object does not support item assignment
Works fine here, maybe that's an error from a previous state in your script. It does not come from this snippet.

import bpy

def create_cube(name, cornerPos, size):
    # Set cursor position for the current brick
    bpy.context.scene.cursor_location = cornerPos

    # Add a cube primitive
    bpy.ops.mesh.primitive_cube_add()

    # Get its reference via the active object, and rename
    theBrick = bpy.context.active_object
    theBrick.name = name

    # Set size        
    bpy.ops.transform.resize(value=size)
    bpy.ops.object.transform_apply(scale=True)

    # Return the object
    return theBrick


create_cube("woop", (0,1,2), (1, 2, 1))


The error message 


  TypeError: 'tuple' object does not support item assignment


is something you might get if you have the following code 

&gt;&gt;&gt; some_tuple = (0, 1, 2)
&gt;&gt;&gt; some_tuple[2] = 4  #  &lt;-- you can't do this in tuples
Traceback (most recent call last):
  File "&lt;blender_console&gt;", line 1, in &lt;module&gt;
TypeError: 'tuple' object does not support item assignment


tuples are immutable, if you want to modify an individual element's value then you use a list.

&gt;&gt;&gt; some_list = [0, 1, 2]
&gt;&gt;&gt; some_list[2] = 4
&gt;&gt;&gt; some_list
[0, 1, 4]