Opened 7 years ago

Closed 5 years ago

#13620 closed defect (fixed)

initialization of padic polynomial fails for empty dictionary

Reported by: saraedum Owned by: roed
Priority: trivial Milestone: sage-6.3
Component: padics Keywords: sd59
Cc: Merged in:
Authors: Julian Rueth Reviewers: Martin Albrecht
Report Upstream: N/A Work issues:
Branch: 5678ab7 (Commits) Commit: 5678ab77b990b844d1003a1272184929e7bf38f2
Dependencies: Stopgaps:

Description (last modified by saraedum)

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

  1. trac_13620.patch

to the sage repository.

Attachments (2)

trac_13620.2.patch (3.0 KB) - added by saraedum 7 years ago.
trac_13620.patch (3.0 KB) - added by saraedum 7 years ago.

Download all attachments as: .zip

Change History (14)

Changed 7 years ago by saraedum

comment:1 Changed 7 years ago by saraedum

  • Description modified (diff)

Changed 7 years ago by saraedum

comment:2 Changed 7 years ago by saraedum

apply trac_13620.patch

comment:3 Changed 7 years ago by roed

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 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:5 Changed 6 years ago by niles

  • 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 6 years ago by niles

  • Commit set to b8a859a329efd606ade2ddbca38976e16d338f7d

rebased and converted to git branch; no other changes


New commits:

b8a859aTrac #13620: initialization of padic polynomial from empty dict

comment:7 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 5 years ago by saraedum

  • 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 5 years ago by saraedum

  • Description modified (diff)
  • Keywords sd59 added
  • Status changed from new to needs_review

comment:11 Changed 5 years ago by malb

  • Commit changed from b8a859a329efd606ade2ddbca38976e16d338f7d to 5678ab77b990b844d1003a1272184929e7bf38f2
  • Reviewers set to Martin Albrecht
  • Status changed from needs_review to positive_review

Looks okay.


New commits:

d9190d4Merge branch 'develop' into ticket/13620
5678ab7Trac #13620: initialization of padic polynomial from empty dict

comment:12 Changed 5 years ago by vbraun

  • 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.