Opened 8 years ago
Closed 7 years ago
#13620 closed defect (fixed)
initialization of padic polynomial fails for empty dictionary
Reported by:  saraedum  Owned by:  roed 

Priority:  trivial  Milestone:  sage6.3 
Component:  padics  Keywords:  sd59 
Cc:  Merged in:  
Authors:  Julian Rueth  Reviewers:  Martin Albrecht 
Report Upstream:  N/A  Work issues:  
Branch:  5678ab7 (Commits, GitHub, GitLab)  Commit:  5678ab77b990b844d1003a1272184929e7bf38f2 
Dependencies:  Stopgaps: 
Description (last modified by )
Polynomials over the padics can be initialized from dictionaries.
sage: R.<t> = Qp(3)[] sage: f = R.one() sage: R(f.dict())
However, this fails for empty dictionaries:
sage: f = R.zero() sage: R(f.dict()) ValueError: max() arg is an empty sequence
The attached patch fixes this.
Apply
to the sage repository.
Attachments (2)
Change History (14)
Changed 8 years ago by
comment:1 Changed 8 years ago by
 Description modified (diff)
Changed 8 years ago by
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
Looks fine. My one comment would be that you can use max(x.keys()) if x else 0
rather than max(x.keys()) if len(x) else 0
. Let me know when you want it reviewed.
comment:4 Changed 8 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:5 Changed 7 years ago by
 Branch set to u/niles/ticket/13620
 Created changed from 10/19/12 02:51:11 to 10/19/12 02:51:11
 Modified changed from 08/13/13 15:35:53 to 08/13/13 15:35:53
comment:6 Changed 7 years ago by
 Commit set to b8a859a329efd606ade2ddbca38976e16d338f7d
rebased and converted to git branch; no other changes
New commits:
b8a859a  Trac #13620: initialization of padic polynomial from empty dict

comment:7 Changed 7 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:8 Changed 7 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:9 Changed 7 years ago by
 Branch changed from u/niles/ticket/13620 to u/saraedum/ticket/13620
 Modified changed from 05/06/14 15:20:58 to 05/06/14 15:20:58
comment:10 Changed 7 years ago by
 Description modified (diff)
 Keywords sd59 added
 Status changed from new to needs_review
comment:11 Changed 7 years ago by
 Commit changed from b8a859a329efd606ade2ddbca38976e16d338f7d to 5678ab77b990b844d1003a1272184929e7bf38f2
 Reviewers set to Martin Albrecht
 Status changed from needs_review to positive_review
comment:12 Changed 7 years ago by
 Branch changed from u/saraedum/ticket/13620 to 5678ab77b990b844d1003a1272184929e7bf38f2
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
apply trac_13620.patch