#10963: More functorial constructions
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner: stumpc5
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.2
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-doc- | Commit:
distributive | 7ab3103368e46d33f37e135a9eb09a1e16a029a7
Dependencies: #11224, #8327, | Stopgaps:
#10193, #12895, #14516, #14722, |
#13589, #14471, #15069, #15094, |
#11688, #13394, #15150, #15506 |
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Part of my confusion is due to those things:
{{{
sage: Semigroups().Finite
Cached version of <function Finite at 0xa4c2c6c>
sage: Semigroups().__class__.Finite
<class 'sage.categories.finite_semigroups.FiniteSemigroups'>
}}}
I think it needs to be explained in the doc both ''how'' and ''why''
`Semigroups()` does not use the attribute that is defined in its class.
Concerning "how", sure, it is happening in `Semigroups().__dict__`. But
what part of the code is putting the cached method into `__dict__`,
overriding the (lazily imported) class "`FiniteSemigroups`" that is stored
as a class attribute? Is it generally the case that a `SubcategoryMethod`
overrides a class attribute on instances???
Concerning "why": I think it is absolutely necessary to give a good
rationale. After all, the cached method that `Semigroups()` inherits from
`Sets.SubcategoryMethods` is eventually just returning
`Semigroups.Finite()` (which is ''not'' inherited from
`Sets.SubcategoryMethods`). So, what would change if `Semigroups().Finite`
would be gotten from `Semigroups.Finite`?
--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:535>
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.