Ticket #7251 (closed enhancement: fixed)
Allow for Integer(3, parent = MyParent)
| Reported by: | nthiery | Owned by: | nthiery |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.2 |
| Component: | basic arithmetic | Keywords: | Integer, IntegerWrapper |
| Cc: | sage-combinat, mhansen, robertwb | Author(s): | Nicolas M. Thiéry |
| Report Upstream: | Reviewer(s): | Mike Hansen | |
| Merged in: | sage-4.2.alpha1 | Work issues: |
Description
The attached patch allows for the creation of integers whose parents are not IntegerRing?():
sage: n = Integer(3, parent = Primes())
sage: n
3
sage: n.parent()
Set of all prime numbers: 2, 3, 5, 7, ...
That's used in a couple places in the category code #5891, when illustrating how to create new parents like the set of prime integers. So this is quite urgent.
Any better implementation welcome! I am fine also with having this work only for IntegerWrapper?.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

