@@ -114,7 +114,6 @@ from sage.misc.superseded import deprecation
114114from sage.structure.coerce cimport coercion_model
115115from sage.structure.parent cimport Parent
116116from sage.structure.category_object cimport check_default_category
117- from sage.misc.prandom import randint
118117from sage.categories.rings import Rings
119118from sage.categories.algebras import Algebras
120119from sage.categories.commutative_algebras import CommutativeAlgebras
@@ -637,36 +636,6 @@ cdef class Ring(ParentWithGens):
637636 """
638637 return self .zeta().multiplicative_order()
639638
640- def random_element (self , bound = 2 ):
641- """
642- Return a random integer coerced into this ring, where the
643- integer is chosen uniformly from the interval ``[-bound,bound]``.
644-
645- INPUT:
646-
647- - ``bound`` -- integer (default: 2)
648-
649- ALGORITHM:
650-
651- Uses Python's randint.
652-
653- TESTS:
654-
655- The following example returns a :exc:`NotImplementedError` since the
656- generic ring class ``__call__`` function returns a
657- :exc:`NotImplementedError`. Note that
658- ``sage.rings.ring.Ring.random_element`` performs a call in the generic
659- ring class by a random integer::
660-
661- sage: R = sage.rings.ring.Ring(ZZ); R
662- <sage.rings.ring.Ring object at ...>
663- sage: R.random_element()
664- Traceback (most recent call last):
665- ...
666- NotImplementedError: cannot construct elements of <sage.rings.ring.Ring object at ...>
667- """
668- return self (randint(- bound,bound))
669-
670639 @cached_method
671640 def epsilon (self ):
672641 """
0 commit comments