This repository was archived by the owner on Jan 30, 2023. It is now read-only.
File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -252,8 +252,6 @@ cdef class FreeAlgebra_letterplace(Algebra):
252
252
varnames = R.variable_names()[:- 1 ]
253
253
self ._nb_slackvars = 1
254
254
base_ring = R.base_ring()
255
- Algebra.__init__ (self , base_ring, varnames,
256
- normalize = False , category = Algebras(base_ring))
257
255
self ._commutative_ring = R
258
256
self ._current_ring = make_letterplace_ring(R,1 )
259
257
self ._degbound = 1
@@ -264,8 +262,8 @@ cdef class FreeAlgebra_letterplace(Algebra):
264
262
raise TypeError (" The generator degrees must be given by a list or tuple of %d positive integers" % (self .__ngens- 1 ))
265
263
self ._degrees = tuple ([int (i) for i in degrees])
266
264
self .set_degbound(max (self ._degrees))
267
- self ._populate_coercion_lists_( coerce_list = [ base_ring])
268
-
265
+ Algebra. __init__ ( self , base_ring, varnames,
266
+ normalize = False , category = Algebras(base_ring))
269
267
def __reduce__ (self ):
270
268
"""
271
269
TESTS::
Original file line number Diff line number Diff line change @@ -3660,10 +3660,14 @@ def pushout(R, S):
3660
3660
[1 2 0]
3661
3661
[0 0 1]
3662
3662
3663
- Some more tests with ``coercion_reversed = True``::
3663
+ Here are some more tests with ``coercion_reversed = True``. Note that
3664
+ in the following test, we are not inheriting from ``type(QQ['x'])``,
3665
+ since this already inherits from a category's parent class: If this
3666
+ is the case for a class, the the category framework will not be correctly
3667
+ initialised for instances of this class. ::
3664
3668
3665
3669
sage: from sage.categories.pushout import ConstructionFunctor
3666
- sage: class EvenPolynomialRing(type(QQ['x'])):
3670
+ sage: class EvenPolynomialRing(type(QQ['x']).__base__ ):
3667
3671
....: def __init__(self, base, var):
3668
3672
....: super(EvenPolynomialRing, self).__init__(base, var)
3669
3673
....: self.register_embedding(base[var])
Original file line number Diff line number Diff line change @@ -344,12 +344,12 @@ cdef class Parent(sage.structure.category_object.CategoryObject):
344
344
# this calls __init_extra__ if it is *defined* in cls (not in a super class)
345
345
if " __init_extra__" in cls .__dict__:
346
346
cls .__init_extra__(self )
347
- if not (( category is None ) or isinstance ( self , category.parent_class)) :
347
+ if category is not None :
348
348
# This is the case if and only if self is an instance of an
349
349
# extension class. Now, we should go up the class hierarchy
350
350
# of the category's parent class and seek for "__init_extra__".
351
351
for cls in category.parent_class.mro():
352
- if " __init_extra__" in cls .__dict__:
352
+ if not isinstance ( self , cls ) and " __init_extra__" in cls .__dict__:
353
353
getattr_from_other_class(self , cls , ' __init_extra__' )()
354
354
355
355
def _init_category_ (self , category ):
You can’t perform that action at this time.
0 commit comments