(target, attr)
Get `attr` of `target` (a list/dictionary/generic object).
Get `attr` of `target` (a list/dictionary/generic object).
Get attr of target ( a list / dictionary / generic object ) .
def corner_case_getattr(target, attr):
  """Get `attr` of `target` (a list/dictionary/generic object)."""
  if isinstance(target, collections.abc.Sequence):
    return target[int(attr)]
  elif isinstance(target, collections.abc.Mapping):
    return target[attr]
  else:
    return getattr(target, attr)
def corner_case_getattr ( target , attr ) : if isinstance ( target , collections . abc . Sequence ) : return target [ int ( attr ) ] elif isinstance ( target , collections . abc . Mapping ) : return target [ attr ] else : return getattr ( target , attr )