#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:11 darij]:
> Why do we need a class for compositions of maps, by the way? Isn't that
the same as just... maps?
We don't, and the composition of maps can be obtained using `phi*psi`
(which will have its own clashes if you want pointwise products for maps
into a multiplicative group). However, the fact that the slot in the
global namespace is in principle available doesn't imply it should be used
for a special notion.
The title of the ticket already shows the confusion that can arise: The
ticket complains that `Composition` is too lax with its argument checking
and at the same time it seems `Composition` doesn't accept inputs that are
perfectly valid for a mathematically widely accepted meaning of the word.
Note that the full name is fine:
{{{
sage.combinat.composition.Composition
}}}
[Note that it is a function, not a class, by the way]. I just think it's
inappropriate to import it into the global namespace under such a generic
name. If you make that
{{{
from sage.combinat.composition import Composition as IntegerComposition
}}}
you should be fine and a lot less ambiguous already. With a system that is
the scope of sage we really have to be careful with the global namespace.
It is a very scarce resource.
I like `IntegerComposition`, by the way, and I don't think `Partition` is
that problematic. If that becomes problematic, we can probably write a
generic Partition routine to be imported in the global namespace that
dispatches to the appropriate routine (!IntegerPartition or !SetPartition
or whatever) based on type of the input parameters.
--
Ticket URL: <http://trac.sagemath.org/ticket/14862#comment:12>
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.