Open 3f8450e1-87bf-41c6-ab53-29a0552debb3 opened 10 years ago
It in fact does not work either: a parent in Modules(...)
should
implement a base_ring method. This method just turns out not to be
called upon initialization if B is just in Modules()
instead of
Algebras()
, so the problem goes undetected, so far ...
It indeed feels a bit redundant to have to specify the base ring in
the category and in the base_ring
method. The thing is that, in the
category, one can now specify something like Algebras(Rings())
; I'd
say it's even recommended. So one can't recover the base ring from the
just the category. It's not so bad, because more often than not, when
implementing a module, one inherits from some preexisting module that
implements base_ring
for us.
Now, yes, definitely, this all might not be stated explicitly in the documentation; and the error message is not informative ...
Step that can be taken right away:
base_ring
abstract method in Modules.ParentMethods
Steps that are a bit more tricky (I tried and dropped the case; but I had to act fast then to get #10963 in):
Remove the base_ring
method from CategoryObject
(it has nothing to
do there).
Implement a base_ring
method for all the existing modules
(polynomials, ...), putting it in common abstract super classes
whenever possible.
Cheers, Nicolas
Strange problem:
That fails! (6.2 rc 2):
But if I try to change the super categories:
That works! What's error mean?
CC: @nthiery
Component: categories
Issue created by migration from https://trac.sagemath.org/ticket/16443