#14862: Compositions accept any input
-------------------------------------+-------------------------------------
Reporter: stumpc5 | Owner: sage-combinat
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.13
Component: combinatorics | Resolution:
Keywords: composition, | Merged in:
FindStat | Reviewers:
Authors: | Work issues: provide a test in the
Report Upstream: N/A | constructor
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
Replying to [comment:13 darij]:
> It is a class:
> {{{
> class Composition(CombinatorialObject, Element):
> }}}
Ah you're right. It wasn't in Sage 5.7.
> Shouldn't a function "composition" be written in lowercase?
That depends. If it's a "factory function" it's really meant to be a class
constructor, but some implementation details prevented it from being
written that way. So then the capitalization could still make sense. With
that in mind it's more a judgement call whether to capitalize something.
> It would slow things down, though... unless we change all calls to
`Partition` via patchbombing.
Do you have timings to back that up? It shouldn't (depending on what "It"
is).
If you mean using a `from ... import ... as ...` construction: that should
lead to exactly the same performance. It just means the link in the
relevant namespace dict is stored under a different key than would be
chosen by default. There is no extra link step to follow.
If you mean the extra redirection in a global namespace generic dispatch
routine: yes, that would have a bit of overhead. But that's always the
case: it's much better to use specific routines, that are likely not
available directly from the global namespace.
--
Ticket URL: <http://trac.sagemath.org/ticket/14862#comment:16>
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.