def isdistinct(seq):
 if (iter(seq) is seq):
  seen = set()
  seen_add = seen.add
  for item in seq:
   if (item in seen):
    return False
   seen_add(item)
  return True
 else:
  return (len(seq) == len(set(seq)))

def isdistinct ( seq ) : if ( iter ( seq ) is seq ) : seen = set ( ) seen_add = seen . add for item in seq : if ( item in seen ) : return False seen_add ( item ) return True else : return ( len ( seq ) == len ( set ( seq ) ) )
all values in sequence are distinct .