Ticket #2208 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch, with positive review] implement is_field for rings of integers

Reported by: was Owned by: craigcitro
Priority: major Milestone: sage-2.10.3
Component: number theory Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

sage: R = CyclotomicField(4).ring_of_integers()
sage: R.is_field()
---------------------------------------------------------------------------
<type 'exceptions.NotImplementedError'>   Traceback (most recent call last)

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/<ipython console> in <module>()

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/ring.pyx in sage.rings.ring.IntegralDomain.is_field()

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/ring.pyx in sage.rings.ring.Ring.is_finite()

<type 'exceptions.NotImplementedError'>: 

Also

sage: R = NumberField(x^3 + 2, 'a').ring_of_integers()
sage: R.is_field()
---------------------------------------------------------------------------
<type 'exceptions.NotImplementedError'>   Traceback (most recent call last)

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/<ipython console> in <module>()

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/ring.pyx in sage.rings.ring.IntegralDomain.is_field()

/Users/was/build/sage-2.10.2.alpha0/devel/sage-review/sage/modular/ring.pyx in sage.rings.ring.Ring.is_finite()

<type 'exceptions.NotImplementedError'>:

Attachments

trac-2208.patch Download (1.1 KB) - added by craigcitro 5 years ago.

Change History

comment:1 Changed 5 years ago by craigcitro

  • Owner changed from was to craigcitro
  • Status changed from new to assigned
  • Summary changed from implement is_field for rings of integers to [with patch, needs very quick review] implement is_field for rings of integers

Made the obvious fix, both the examples above now work (though there are different doctests).

comment:2 Changed 5 years ago by was

I would delete "This exists for compatibility purposes." from the docstring. It really says nothing useful and if we're going to write that we could write that sort of thing all over the place.

Changed 5 years ago by craigcitro

comment:3 Changed 5 years ago by craigcitro

New patch posted, removes the questionable verbiage. Adds another doctest.

comment:4 Changed 5 years ago by ncalexan

  • Summary changed from [with patch, needs very quick review] implement is_field for rings of integers to [with patch, with positive review] implement is_field for rings of integers

Looks good to me.

comment:5 Changed 5 years ago by mabshoff

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in Sage 2.10.3.alpha0

Note: See TracTickets for help on using tickets.