def _check_for_setattr(instance):
 module = instance.get_parent_until()
 try:
  stmts = module.used_names['setattr']
 except KeyError:
  return False
 return any(((instance.start_pos < stmt.start_pos < instance.end_pos) for stmt in stmts))

def _check_for_setattr ( instance ) : module = instance . get_parent_until ( ) try : stmts = module . used_names [ 'setattr' ] except KeyError : return False return any ( ( ( instance . start_pos < stmt . start_pos < instance . end_pos ) for stmt in stmts ) )
check if theres any setattr method inside an instance .