#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, | eb7b486c6fecac296052f980788e15e2ad1b59e4
#10193, #12895, #14516, #14722, | Stopgaps:
#13589, #14471, #15069, #15094, |
#11688, #13394, #15150, #15506 |
-------------------------------------+-------------------------------------
Comment (by vbraun):
Replying to [comment:470 nthiery]:
> Replying to [comment:467 vbraun]:
> Why is there a single defining axiom, the self._axiom attribute?
> See [comment:464]. One wants to be incremental in most cases
> anyway.
I'm not talking about the user interface with the successive
`category.Axiom()` factory methods (implemented as actual methods or
`__classcall__`). I'm talking about the code layout, where deeply nested
classes are rather cumbersome. There, I don't want to be forced to add one
axiom at a time if I only have code to attach to the case of multiple
axioms. I especially don't want five-fold nested classes just to express
that I want factory methods for those five.
> But there is no standard implementation and syntax for dynamic mixins.
True, but there are only two sane options: Either use some tricks to turn
the static into dynamic mixins (the DWIM principle) or explicitly specify
the dynamic mixins in a class atttribute. Really, that just boils down to
using either inheritance or object composition to express relations
between classes in code.
> I believe nested classes are an *opportunity* given to us by Python to
> structure the code; it just has been under-exploited yet.
I'm happy with nested classes, but beyond level two it is quickly becoming
an annoyance.
--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:471>
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.