Skip to content

Commit

Permalink
fix suggested details
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Feb 24, 2024
1 parent 39252f4 commit 4cff0fe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/sage/categories/action.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ cdef class InverseAction(Action):
def __init__(self, Action action):
G = action.G
try:
from sage.groups.group import is_Group
from sage.groups.group import Group
# We must be in the case that parent(~a) == parent(a)
# so we can invert in _call_ code below.
if (is_Group(G) and G.is_multiplicative()) or G.is_field():
if (isinstance(G, Group) and G.is_multiplicative()) or G.is_field():
Action.__init__(self, G, action.underlying_set(), action._is_left)
self._action = action
return
Expand Down
12 changes: 7 additions & 5 deletions src/sage/groups/additive_abelian/additive_abelian_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
major differences are in the way elements are printed.
"""

from sage.structure.parent import Parent
from sage.modules.fg_pid.fgp_module import FGP_Module_class
from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups
from sage.modules.fg_pid.fgp_element import FGP_Element
from sage.modules.fg_pid.fgp_module import FGP_Module_class
from sage.rings.integer_ring import ZZ
from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups


def AdditiveAbelianGroup(invs, remember_generators=True):
Expand Down Expand Up @@ -202,7 +201,7 @@ def _repr_(self) -> str:
# since we want to inherit things like __hash__ from there rather than the
# hyper-generic implementation for abstract abelian groups.

class AdditiveAbelianGroup_class(FGP_Module_class, Parent):
class AdditiveAbelianGroup_class(FGP_Module_class):
r"""
An additive abelian group, implemented using the `\ZZ`-module machinery.
Expand All @@ -224,9 +223,12 @@ def __init__(self, cover, relations):
Additive abelian group isomorphic to Z
sage: G == loads(dumps(G))
True
sage: G.category()
Category of modules over Integer Ring
sage: G in CommutativeAdditiveGroups()
True
"""
FGP_Module_class.__init__(self, cover, relations)
Parent.__init__(self, category=CommutativeAdditiveGroups())

def _repr_(self):
r"""
Expand Down
9 changes: 6 additions & 3 deletions src/sage/groups/group.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Base class for groups
#
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.structure.parent cimport Parent
from sage.misc.superseded import deprecation
from sage.rings.infinity import infinity
from sage.structure.parent cimport Parent


def is_Group(x) -> bool:
def is_Group(x):
"""
Return whether ``x`` is a group object.
Expand All @@ -38,10 +38,13 @@ def is_Group(x) -> bool:
sage: F.<a,b> = FreeGroup() # needs sage.groups
sage: from sage.groups.group import is_Group
sage: is_Group(F) # needs sage.groups
doctest:warning...DeprecationWarning: use instead G in Groups()
See https://github.com/sagemath/sage/issues/37449 for details.
True
sage: is_Group("a string")
False
"""
deprecation(37449, 'use instead G in Groups()')
return isinstance(x, Group)


Expand Down
4 changes: 2 additions & 2 deletions src/sage/groups/old.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Deprecated Base class for groups
Deprecated base class for groups
"""

# ****************************************************************************
Expand All @@ -18,7 +18,7 @@ Deprecated Base class for groups
# ****************************************************************************

doc = """
Deprecated Base class for all groups
Deprecated base class for all groups
"""
import sage.rings.integer_ring
from sage.misc.superseded import deprecation
Expand Down

0 comments on commit 4cff0fe

Please sign in to comment.