From: Michael Orlitzky Date: Sat, 21 Feb 2026 15:25:52 +0000 (-0500) Subject: mjo/clan/clan_operator.py: undo _is_clan() hack X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=245f6375842606e82c8e6c1a458ac40bf83ff6df;p=sage.d.git mjo/clan/clan_operator.py: undo _is_clan() hack And just like that, it starts working for no reason. --- diff --git a/mjo/clan/clan_operator.py b/mjo/clan/clan_operator.py index a738d22..9f689e5 100644 --- a/mjo/clan/clan_operator.py +++ b/mjo/clan/clan_operator.py @@ -1,13 +1,6 @@ from sage.categories.map import Map from sage.categories.modules_with_basis import ModulesWithBasis -def _is_clan(x): - r""" - I'm sure there's a great reason why this basic functionality - doesn't work, but I don't have the time to waste right now. - """ - return any( str(c).startswith("Category of clans") - for c in x.categories() ) class ClanOperator(Map): r""" @@ -38,9 +31,12 @@ class ClanOperator(Map): """ def __init__(self, domain, codomain, mat): - if not _is_clan(domain): + from mjo.clan.clan import Clans + + # Uses __classcontains__ hack for parametrized categories + if not domain in Clans: raise TypeError("domain must be a clan") - if not _is_clan(codomain): + if not codomain in Clans: raise TypeError("codomain must be a clan") F = domain.base_ring()