import collections ModifiableProperty = collections.namedtuple('ModifiableProperty', ['getter', 'setter']) ModifiablePropertyWithAst = collections.namedtuple('ModifiablePropertyWithAst', [ 'getter', 'setter', 'ast', 'elements', ]) def is_modifiable_property(element): return (isinstance(element, ModifiableProperty) or isinstance(element, ModifiablePropertyWithAst))