From 7b3bb5b23a22f54ac5b62e35ec8be1925623d9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Tue, 6 Feb 2024 12:21:46 +0100 Subject: [PATCH] fix one doctest --- src/sage/modules/free_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/modules/free_module.py b/src/sage/modules/free_module.py index 7c880f87b29..10343f41b95 100644 --- a/src/sage/modules/free_module.py +++ b/src/sage/modules/free_module.py @@ -187,6 +187,7 @@ import sage.rings.integer_ring import sage.rings.rational_field from sage.rings.ring import IntegralDomain, is_Ring +from sage.categories.fields import Fields from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.categories.integral_domains import IntegralDomains from sage.categories.principal_ideal_domains import PrincipalIdealDomains @@ -4347,7 +4348,7 @@ def __init__(self, base_field, dimension, degree, sparse=False, category=None): sage: FreeModule_generic_field(QQ, 5, 5) ) failed: NotImplementedError> """ - if not isinstance(base_field, ring.Field): + if base_field not in Fields(): raise TypeError("The base_field (=%s) must be a field" % base_field) super().__init__(base_field, dimension, degree, sparse=sparse, category=category)