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

Commit

Permalink
split __normalize__ from __classcall__ (to deal better with inheritance)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 18, 2016
1 parent 6b67851 commit 5cf8f56
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/sage/combinat/recognizable_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,20 @@ class RecognizableSeriesSpace(UniqueRepresentation, Parent):


@staticmethod
def __classcall__(cls,
def __classcall__(cls, *args, **kwds):
r"""
Prepare normalizing the input in order to ensure a
unique representation.
For more information see :class:`ReconizableSeriesSpace`
and :meth:`__normalize__'.
"""
return super(RecognizableSeriesSpace, cls).__classcall__(
cls, *cls.__normalize__(*args, **kwds))


@classmethod
def __normalize__(cls,
coefficients=None, alphabet=None,
indices=None, algebra=None,
category=None):
Expand Down Expand Up @@ -843,8 +856,7 @@ def key_to_cmp(a, b, key):
from sage.categories.sets_cat import Sets
category = category or algebra.category()

return super(RecognizableSeriesSpace, cls).__classcall__(
cls, algebra, category)
return (algebra, category)


def __init__(self, algebra, category):
Expand Down

0 comments on commit 5cf8f56

Please sign in to comment.