diff --git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index f6f66245dff..c39a29b66af 100644 --- a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py @@ -795,61 +795,6 @@ def ideal(self, *args, **kwds): gens = gens[0] return C(self, gens, **kwds) - def _ideal_class_(self, n=0): - """ - Return the class that is used to implement ideals of this ring. - - .. NOTE:: - - We copy the code from :class:`~sage.rings.ring.Ring`. This is - necessary because not all rings inherit from that class, such - as matrix algebras. - - INPUT: - - - ``n`` (optional integer, default 0): The number of generators - of the ideal to be created. - - OUTPUT: - - The class that is used to implement ideals of this ring with - ``n`` generators. - - .. NOTE:: - - Often principal ideals (``n==1``) are implemented via - a different class. - - EXAMPLES:: - - sage: MS = MatrixSpace(QQ, 2, 2) # needs sage.modules - sage: MS._ideal_class_() # needs sage.modules - - - We do not know of a commutative ring in Sage that does not inherit - from the base class of rings. So, we need to cheat in the next - example:: - - sage: super(Ring,QQ)._ideal_class_.__module__ - 'sage.categories.commutative_rings' - sage: super(Ring,QQ)._ideal_class_() - - sage: super(Ring,QQ)._ideal_class_(1) - - sage: super(Ring,QQ)._ideal_class_(2) - - """ - from sage.rings.noncommutative_ideals import Ideal_nc - try: - if not self.is_commutative(): - return Ideal_nc - except (NotImplementedError, AttributeError): - return Ideal_nc - from sage.rings.ideal import Ideal_generic, Ideal_principal - if n == 1: - return Ideal_principal - return Ideal_generic - ## # Quotient rings def quotient(self, I, names=None, **kwds): diff --git a/src/sage/rings/function_field/ideal.py b/src/sage/rings/function_field/ideal.py index 22aa15299b1..21ccf2b4f4c 100644 --- a/src/sage/rings/function_field/ideal.py +++ b/src/sage/rings/function_field/ideal.py @@ -1070,7 +1070,7 @@ def __init__(self, R): sage: M = O.ideal_monoid() sage: TestSuite(M).run() """ - self.Element = R._ideal_class + self.Element = R._ideal_class_ Parent.__init__(self, category=Monoids()) self.__R = R diff --git a/src/sage/rings/function_field/order.py b/src/sage/rings/function_field/order.py index 615cbab3690..a1cb369ee8e 100644 --- a/src/sage/rings/function_field/order.py +++ b/src/sage/rings/function_field/order.py @@ -146,7 +146,7 @@ def __init__(self, field, ideal_class=FunctionFieldIdeal, category=None): category = IntegralDomains().or_subcategory(category).Infinite() Parent.__init__(self, category=category, facade=field) - self._ideal_class = ideal_class # element class for parent ideal monoid + self._ideal_class_ = ideal_class # element class for parent ideal monoid self._field = field def is_field(self, proof=True):