# HG changeset patch
# User Bartosz Naskrecki <nasqret@gmail.com>
# Date 1374802113 25200
# Node ID cc54f2e563c16fd21f76f13eaa4c79b6414d54dd
# Parent 995fbbf0196f8c00d0d66a64a425564a2bca0705
trac 14368: Fix of the problem that DirichletGroup(1).list() returns the zero character in modular/dirichlet.py
diff git a/sage/modular/dirichlet.py b/sage/modular/dirichlet.py
a

b


299  299  pass 
300  300  
301  301  val = self.__modulus  1 
302   if not val: 
303   one = self.base_ring()(1) 
304   self.__values = [self.base_ring()(1)] 
305   return self.__values[0] 
306   elif m == val: 
 302  if m == val: 
307  303  return self.__eval_at_minus_one() 
308  304  else: 
309  305  self.values() # compute all values 
… 
… 

1449  1445  zeta10, 
1450  1446  zeta10^3  zeta10^2 + zeta10  1, 
1451  1447  zeta10^2] 
 1448  
 1449  Test that :trac:`14368` is fixed:: 
 1450  
 1451  sage: DirichletGroup(1).list()[0].values() 
 1452  [1] 
1452  1453  """ 
1453  1454  try: 
1454  1455  return self.__values 
… 
… 

1466  1467  
1467  1468  if self.is_trivial(): # easy special case 
1468  1469  x = [ one ] * int(mod) 
1469   x[0] = zero 
 1470  
1470  1471  for p in mod.prime_divisors(): 
1471  1472  p_mult = p 
1472  1473  while p_mult < mod: 
1473  1474  x[p_mult] = zero 
1474  1475  p_mult += p 
 1476  if not (mod == 1): 
 1477  x[0] = zero 
1475  1478  self.__values = x 
1476  1479  return x 
1477  1480  