How to store Render settings in a list for modification?

So I want to dynamically change several render settings in a Python script. I need a function to be able to call the setting from an index or a key, so that it modifies the correct setting. Since there is about 10 settings I want to modify the only way I can get the desired result is by having a bunch of IF statements for each possible setting. That seems like a terrible way to do it. Is there a way to save the settings to a list or dictionary?

Heres an example:


import bpy

<b>bpy.data.scenes[0].cycles.samples = 1 </b><b># Number of samples</b><b>
lis = [bpy.data.scenes[0].cycles.samples]
lis[0] = (10)</b>


print ('Actual ' + str(bpy.data.scenes[0].cycles.samples))
print ('Modified ' + str(lis[0]))

Output:

Actual 1
Modified 10


It should produce:

Actual 10
Modified 10


It appears to be a “feature” of python, http://stackoverflow.com/questions/3106689/pointers-in-python
The current third answer alludes to a solution similar to yours but I didn’t figure it without wrapping it which you can’t in this case. I think you may have to manually update at the end…