#14145: Problems with contains for Tableau, TableauTuples and PartitionTuples
-----------------------------+----------------------------------------------
Reporter: andrew.mathas | Owner: sage-combinat
Type: defect | Status: new
Priority: major | Milestone: sage-5.8
Component: combinatorics | Keywords: sage45
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
The following three commands all lead to errors:
{{{
sage: 1 in Tableaux()
sage: 1 in TableauTuples()
sage: 1 in PartitionTuples()
}}}
In all cases, sage reports
{{{
TypeError: 'sage.rings.integer.Integer' object is not iterable
}}}
The place where sage is failing is in CombinatorialObject.__init__ where
we have:
{{{#!python
if isinstance(l, list):
self._list = l
else:
self._list = list(l)
}}}
The error arises because l==1 is not a list. The discussion on
[https://groups.google.com/forum/?fromgroups=#!topic/sage-combinat-
devel/J22BDid0sZw sage combinat] concluded that this was more a bug in the
__contains__ methods of these classes rather than in
CombinatorialObject.__init__ -- although, I do think that
CombinatorialObject should trap this error and print a more informative
error message.
Anyway, contains should never give rise to an error, so the contains
methods of these classes need to be fixed.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14145>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.