Opened 9 years ago

Closed 9 years ago

#13592 closed enhancement (fixed)

padics should not be iterable

Reported by: saraedum Owned by: roed
Priority: trivial Milestone: sage-5.5
Component: padics Keywords:
Cc: Merged in: sage-5.5.beta0
Authors: Julian Rueth Reviewers: David Roe
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by saraedum)

Currently, one can iterate over a padic element. So the following code runs forever:

sage: for c in Qp(3).zero():
...       pass

This causes some trouble, see #13302 and I think that padics should not return iterators at all.

What should the iterator for Qp(3).zero() be — should it be infinite or empty? Should the iterator for Zp(3)(3) and Qp(3)(3) iterate over [0,1] or over [1]?

I believe that if one wants to iterate over the terms, then one should have to call .list() or similar explicitly.

Attachments (1)

trac_13592.patch (2.5 KB) - added by saraedum 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by saraedum

comment:1 Changed 9 years ago by saraedum

  • Description modified (diff)

comment:2 Changed 9 years ago by saraedum

  • Status changed from new to needs_review

comment:3 Changed 9 years ago by roed

  • Status changed from needs_review to positive_review

Seems reasonable.

comment:4 Changed 9 years ago by jdemeyer

  • Reviewers set to David Roe

comment:5 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.5.beta0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.