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

Commit

Permalink
replace some class' base class with InheritComparisonUniqueRepresenta…
Browse files Browse the repository at this point in the history
…tion where possible
  • Loading branch information
embray committed May 17, 2018
1 parent f896080 commit 8d665aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
11 changes: 4 additions & 7 deletions src/sage/algebras/clifford_algebra.py
Expand Up @@ -17,9 +17,9 @@
#*****************************************************************************
from six import iteritems

from sage.misc.six import with_metaclass
from sage.misc.cachefunc import cached_method
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.unique_representation import (
InheritComparisonUniqueRepresentation)
from copy import copy

from sage.categories.algebras_with_basis import AlgebrasWithBasis
Expand All @@ -35,7 +35,6 @@
from sage.combinat.subset import SubsetsSorted
from sage.quadratic_forms.quadratic_form import QuadraticForm
from sage.algebras.weyl_algebra import repr_from_monomials
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass


class CliffordAlgebraElement(CombinatorialFreeModule.Element):
Expand Down Expand Up @@ -2161,10 +2160,8 @@ def scalar(self, other):
#####################################################################
## Differentials

class ExteriorAlgebraDifferential(with_metaclass(
InheritComparisonClasscallMetaclass,
ModuleMorphismByLinearity, UniqueRepresentation
)):
class ExteriorAlgebraDifferential(ModuleMorphismByLinearity,
InheritComparisonUniqueRepresentation):
r"""
Internal class to store the data of a boundary or coboundary of
an exterior algebra `\Lambda(L)` defined by the structure
Expand Down
12 changes: 4 additions & 8 deletions src/sage/algebras/commutative_dga.py
Expand Up @@ -74,11 +74,10 @@
from __future__ import print_function, absolute_import
from six import string_types

from sage.misc.six import with_metaclass
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.unique_representation import (
InheritComparisonUniqueRepresentation, UniqueRepresentation)
from sage.structure.sage_object import SageObject
from sage.misc.cachefunc import cached_method
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.misc.functional import is_odd, is_even
from sage.misc.misc_c import prod
from sage.categories.algebras import Algebras
Expand All @@ -99,10 +98,7 @@
from sage.rings.quotient_ring_element import QuotientRingElement


class Differential(with_metaclass(
InheritComparisonClasscallMetaclass,
UniqueRepresentation, Morphism
)):
class Differential(InheritComparisonUniqueRepresentation, Morphism):
r"""
Differential of a commutative graded algebra.
Expand Down Expand Up @@ -935,7 +931,7 @@ def _repr_(self):
sage: A
Graded Commutative Algebra with generators ('x', 'y', 'z', 't') in degrees (3, 4, 2, 1) over Rational Field
sage: A.quotient(A.ideal(3*x*z - 2*y*t))
Graded Commutative Algebra with generators ('x', 'y', 'z', 't') in degrees (3, 4, 2, 1) with relations [3*x*z - 2*y*t] over Rational Field
Graded Commutative Algebra with generators ('x', 'y', 'z', 't') in degrees (3, 4, 2, 1) with relations [3*x*z - 2*y*t] over Rational Field
"""
s = "Graded Commutative Algebra with generators {} in degrees {}".format(self._names, self._degrees)
# Find any nontrivial relations.
Expand Down
11 changes: 4 additions & 7 deletions src/sage/modular/modform_hecketriangle/graded_ring_element.py
Expand Up @@ -17,7 +17,6 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from sage.misc import six
from sage.rings.all import ZZ, infinity, LaurentSeries, O
from sage.functions.all import exp
from sage.rings.number_field.number_field import QuadraticField
Expand All @@ -26,13 +25,13 @@
from sage.structure.parent_gens import localvars
from sage.structure.richcmp import op_NE, op_EQ
from sage.structure.element import CommutativeAlgebraElement
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.unique_representation import (
InheritComparisonUniqueRepresentation)

from sage.modules.free_module_element import vector
from sage.geometry.hyperbolic_space.hyperbolic_interface import HyperbolicPlane

from sage.misc.cachefunc import cached_method
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass

from .constructor import rational_type, FormsSpace, FormsRing
from .series_constructor import MFSeriesConstructor
Expand All @@ -42,10 +41,8 @@
# corresponding operations (e.g. __pow__) even though the category
# (and class) of the parent is in some cases not
# CommutativeAlgebras but Modules
class FormsRingElement(six.with_metaclass(
InheritComparisonClasscallMetaclass,
CommutativeAlgebraElement, UniqueRepresentation
)):
class FormsRingElement(CommutativeAlgebraElement,
InheritComparisonUniqueRepresentation):
r"""
Element of a FormsRing.
"""
Expand Down

0 comments on commit 8d665aa

Please sign in to comment.