How to compare modifiers with python?
A function that returns True if all the properties of mod1 match mod2

def mod_equality(mod1, mod2, ignore=["name"]):
    return all(getattr(mod1, prop, True)
             == getattr(mod2, prop, False)
             for prop in mod1.bl_rna.properties.keys()
             if prop not in ignore)


Edit: added an ignore list.

Simple test in console, Cube with Subsurf modifier and copied.

&gt;&gt;&gt; m1
bpy.data.objects['Cube.001'].modifiers["Subsurf"]

&gt;&gt;&gt; m2
bpy.data.objects['Cube'].modifiers["Subsurf"]

&gt;&gt;&gt; m1 == m2
False

&gt;&gt;&gt; def mod_equality(mod1, mod2):
...     return all(getattr(mod1, prop, True)
...              == getattr(mod2, prop, False)
...              for prop in mod1.bl_rna.properties.keys())
...              
&gt;&gt;&gt; mod_equality(m1, m2)
True


A method to see if one object has same modifiers, all with same settings and in same order as another object

def same_modifier_stack_ordered(obj1, obj2):
    return all(mod_equality(m, obj2.modifiers[i])
                for i,m in enumerate(obj1.modifiers))