What is the best way to store a list of objects with some linked data? Hey I need to store a list of objects each with a value associated, is storing a list of tuples and splitting it at the end ok? Is there a better way to store multiple values?

#store vars
self.stored_selection = bpy.context.selected_objects
self.stored_bevel_list = []

for obj in self.stored_selection:
    for mod in obj.modifiers:            
        if mod.type == "BEVEL":
            if mod.segments &gt; 1:  

                #store tuple in list (object and number of segments)
                entry = (obj, mod.segments)
                self.stored_bevel_list.append(entry)
                mod.segments = 1

#&lt;modal operator&gt;

#restore each objects segments
for item in self.stored_bevel_list:
    #break tuple into two variables
    item,number = item                
    for mod in item.modifiers:
        mod.segments = number
Custom properties.

Could store the segments in a custom property on the object  with the same name as the modifier.

for obj in self.stored_selection:
    for mod in obj.modifiers:            
        if mod.type == "BEVEL" and mod.segments &gt; 1:
            obj[mod.name] = mod.segments
            mod.segments = 1


and restore with

for obj in self.stored_selection:
    for mod in obj.modifiers:            
        if mod.type == "BEVEL":
            segments = obj.get(mod.name)
            if segments:
                mod.segments = segments
                #del(obj[mod.name]) # remove prop?


Another method would be to make a list of all the bevel modifiers with the segments value.  Need to proceed with a little caution when saving lists of object, or in this case modifier, references. If you remove an object that has the modifier, then try and reference later from list may produce a system fault and crash blender.

bevel_mods = [m, m.segments for o in context.selected_objects
        for m in o.modifiers
        if m.type == 'BEVEL'
        and m.segments &gt; 1]

for m, segments in bevel_mods:
    # print object name modifier name segments
    print(m.id_data.name, m.name, segments)