#11943: The category graph should comply with Python's method resolution order
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.8
Component: categories | Keywords: category graph, method resolution
order
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #11900
---------------------------+------------------------------------------------
Changes (by SimonKing):
* status: needs_review => needs_work
Comment:
Replying to [comment:19 SimonKing]:
> Replying to [comment:18 nthiery]:
> By consequence, I needed to introduce a `base()` method for various
settings. For example, tensor products preserve the base. And for join
categories, I argue: If `C = JoinCategory((C1,C2,...))` then `C.base()`
should be the first answer that one obtains by walking through the list
`C1.base(), C2.base(),...`.
I think that's a bad idea, after all. For example, one would have
{{{
sage: C = Category.join([Algebras(GF(5)),Modules(ZZ)])
sage: C.is_subcategory(Modules(ZZ))
False
}}}
But I have a suggestion:
`base()` provides a speed-up in an important application: Polynomial rings
over F. In that situation, one has a join category that clearly should
have a base, namely F. So, perhaps one should add an optional parameter
`base=None` to the construction of a join category.
So, one could have something like
{{{
sage: P.<x,y> = QQ[]
sage: P.category()
Join over Rational Field of Category of unique factorization domains and
Category of commutative algebras over Rational Field
sage: P.category().base()
Rational Field
}}}
and at the same time
{{{
sage: C = Category.join([Algebras(GF(5)),Modules(ZZ)])
sage: print C.base()
None
}}}
What do you think?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11943#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.