def divisors(n, generator=False):
 n = as_int(abs(n))
 if isprime(n):
  return [1, n]
 if (n == 1):
  return [1]
 if (n == 0):
  return []
 rv = _divisors(n)
 if (not generator):
  return sorted(rv)
 return rv

def divisors ( n , generator = False ) : n = as_int ( abs ( n ) ) if isprime ( n ) : return [ 1 , n ] if ( n == 1 ) : return [ 1 ] if ( n == 0 ) : return [ ] rv = _divisors ( n ) if ( not generator ) : return sorted ( rv ) return rv
return all divisors of n sorted from 1 .