Make padic some_elements() nontrivial
some_elements()
currently returns 0, 1, p. This makes most of our automated tests trivial.
Something like this should be sufficient:
def _some_elements(self):
p = self(self.prime())
pi = self.uniformizer()
e = self.ramification_index()
yield self.zero()
yield self.one()
yield self.one()
yield p
yield pi
from sage.rings.all import NN
for n in NN.some_elements():
yield p**n
yield pi**n
yield self.zero().add_bigoh(0)
yield self.zero().add_bigoh(self.precision_cap()1)
if self.is_field():
yield self.zero().add_bigoh(2)
for x in self.residue_field().some_elements():
yield self(x)
yield self.teichmuller(x)
def some_elements(self):
r"""
Returns a list of elements in this ring.
This is typically used for running generic tests (see :class:`TestSuite`).
EXAMPLES::
sage: Zp(2).some_elements()
[0, 1 + O(2^20), 2 + O(2^21)]
"""
for x in self._some_elements():
yield x
if self.is_field() and not x.is_zero():
yield ~x
yield x<<1
yield x<<self.precision_cap()1)
however, it should also detect duplicates (using cache_key.)
Change History (9)
Description: 
modified (diff)

Authors: 
→ Julian Rüth

Milestone: 
sage7.2 →
sageduplicate/invalid/wontfix

Reviewers: 
→ Julian Rüth

Status: 
new →
needs_review

Status: 
needs_review →
positive_review

Resolution: 
→ worksforme

Status: 
positive_review →
closed

some_elements()
now returns more elements. Should we considerer that this issue is fixed?