Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 18, 2022
1 parent 2e6b5ef commit 3be7c97
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sage/modules/free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
import sage.misc.latex as latex

from sage.modules.module import Module
import sage.rings.finite_rings.finite_field_constructor as finite_field
import sage.rings.ring as ring
import sage.rings.abc
import sage.rings.integer_ring
Expand All @@ -195,6 +194,7 @@
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.randstate import current_randstate
from sage.rings.finite_rings.finite_field_base import FiniteField
from sage.structure.factory import UniqueFactory
from sage.structure.sequence import Sequence
from sage.structure.richcmp import (richcmp_method, rich_to_bool, richcmp,
Expand Down Expand Up @@ -6348,7 +6348,7 @@ def _element_constructor_(self, e, *args, **kwds):
"""
try:
k = e.parent()
if finite_field.isinstance(k, FiniteField) and k.base_ring() == self.base_ring() and k.degree() == self.degree():
if isinstance(k, FiniteField) and k.base_ring() == self.base_ring() and k.degree() == self.degree():
return self(e._vector_())
except AttributeError:
pass
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/finite_rings/element_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def is_FiniteFieldElement(x):
sage: from sage.rings.finite_rings.element_base import is_FiniteFieldElement
sage: is_FiniteFieldElement(1)
doctest:...: DeprecationWarning: the function is_FiniteFieldElement is deprecated; use isinstance(x, sage.structure.element.FieldElement) and x.parent().is_finite() instead
See https://trac.sagemath.org/32664 for details.
False
sage: is_FiniteFieldElement(IntegerRing())
False
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/finite_rings/finite_field_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ def is_FiniteField(R):
sage: from sage.rings.finite_rings.finite_field_base import FiniteField
sage: is_FiniteField(GF(9,'a'))
doctest:...: DeprecationWarning: the function is_FiniteField is deprecated; use isinstance(x, sage.rings.finite_rings.finite_field_base.FiniteField) instead
See https://trac.sagemath.org/32664 for details.
True
sage: is_FiniteField(GF(next_prime(10^10)))
True
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/finite_rings/finite_field_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,10 @@ def is_PrimeFiniteField(x):
EXAMPLES::
sage: from sage.rings.finite_rings.finite_field_constructor import is_PrimeFiniteField
sage: is_PrimeFiniteField(QQ)
doctest:...: DeprecationWarning: the function is_PrimeFiniteField is deprecated; use isinstance(x, sage.rings.finite_rings.finite_field_base.FiniteField) and x.is_prime_field() instead
See https://trac.sagemath.org/32664 for details.
False
sage: is_PrimeFiniteField(GF(7))
True
Expand Down
6 changes: 5 additions & 1 deletion src/sage/schemes/hyperelliptic_curves/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ def HyperellipticCurve(f, h=0, names=None, PP=None, check_squarefree=True):

genus_classes = {2: HyperellipticCurve_g2}

is_pAdicField = lambda x: isinstance(x, sage.rings.abc.pAdicField)
def is_FiniteField(x):
return isinstance(x, FiniteField)

def is_pAdicField(x):
return isinstance(x, sage.rings.abc.pAdicField)

fields = [
("FiniteField", is_FiniteField, HyperellipticCurve_finite_field),
Expand Down

0 comments on commit 3be7c97

Please sign in to comment.