(target, attr, value)
Set `attr` of `target` (a list/dictionary/generic object) to `value`.
Set `attr` of `target` (a list/dictionary/generic object) to `value`.
Set attr of target ( a list / dictionary / generic object ) to value .
def corner_case_setattr(target, attr, value):
  """Set `attr` of `target` (a list/dictionary/generic object) to `value`."""
  if isinstance(target, collections.abc.Sequence):
    target[int(attr)] = value
  elif isinstance(target, collections.abc.Mapping):
    target[attr] = value
  else:
    setattr(target, attr, value)
def corner_case_setattr ( target , attr , value ) : if isinstance ( target , collections . abc . Sequence ) : target [ int ( attr ) ] = value elif isinstance ( target , collections . abc . Mapping ) : target [ attr ] = value else : setattr ( target , attr , value )