@locked.setter
def locked(self, value):
    'Lock attribute'
    elements = (self if (self.isArray or self.isCompound) else [self])
    for el in elements:
        cmds.setAttr(el.path(), lock=value)
Lock attribute
@locked.setter
def locked(self, value):
    
    elements = (self if (self.isArray or self.isCompound) else [self])
    for el in elements:
        cmds.setAttr(el.path(), lock=value)