Opened 10 years ago

Closed 10 years ago

#13592 closed enhancement (fixed)

padics should not be iterable

Reported by: Julian Rüth Owned by: David Roe
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 Julian Rüth)

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 Julian Rüth 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Julian Rüth

Attachment: trac_13592.patch added

comment:1 Changed 10 years ago by Julian Rüth

Description: modified (diff)

comment:2 Changed 10 years ago by Julian Rüth

Status: newneeds_review

comment:3 Changed 10 years ago by David Roe

Status: needs_reviewpositive_review

Seems reasonable.

comment:4 Changed 10 years ago by Jeroen Demeyer

Reviewers: David Roe

comment:5 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.5.beta0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.