#10963: More functorial constructions
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner: stumpc5
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.1
Component: categories | Resolution:
Keywords: days54 | Merged in:
Authors: Nicolas M. Thiéry | Reviewers: Simon King, Frédéric
Report Upstream: N/A | Chapoton
Branch: | Work issues:
public/ticket/10963 | Commit:
Dependencies: #11224, #8327, | 8045aa4a4b7ada735b3eb6055382f9b341a39f1e
#10193, #12895, #14516, #14722, | Stopgaps:
#13589, #14471, #15069, #15094, |
#11688, #13394, #15150, #15506 |
-------------------------------------+-------------------------------------
Comment (by nthiery):
Replying to [comment:394 vbraun]:
> Why not
> {{{#!python
> class Finite(Axiom):
> class ParentMethods:
> def is_finite(self): return True
>
> class Groups(Category):
> class ParentMethods:
> @requires_axiom(Finite())
> def is_finite_group(self): return True
> }}}
We had a similar syntax in MuPAD / Axiom. There, axioms were basically
predicates on parents which you could test in your code. And they were
organized in a module Ax.Finite, Ax., etc. In practice we never found
an interesting use case for those (and we tried!).
On the other hand, I believe from practical experience that a
mechanism of mixins like that implemented in categories, and further
extended by this patch, can help a lot structuring the code based on
math knowledge.
Of course the downside is that we are necessarily deviating at some
point from standard Python, since Python does not have native support
for mixins. But this is relatively alleviated by the fact that, once
the magic for building the hierarchy of classes for parent and element
is finished, we are back to a purely standard OO; which means that all
standard tools like instrospection and the like work.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:399>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.