One of the examples in the docstring for DisjointUnionEnumeratedSet
goes something like this:

sage: U = DisjointUnionEnumeratedSets(Family(NonNegativeIntegers(),
Permutations))
sage: it = iter(U)
sage: it.next()
[]

If I try the same thing, replacing "Permutations" with "Partitions",
it doesn't work:

sage: U = DisjointUnionEnumeratedSets(Family(NonNegativeIntegers(),
Partitions))
sage: it = iter(U)
sage: it.next()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call
last)

/Users/palmieri/<ipython console> in <module>()

/Applications/sage/local/lib/python2.6/site-packages/sage/sets/
disjoint_union_enumerated_sets.pyc in __iter__(self)
    398         """
    399         for k in self._family.keys():
--> 400             for el in self._family[k]:
    401                 if self._keepkey:
    402                     el = (k, el)

/Applications/sage/local/lib/python2.6/site-packages/sage/sets/
family.pyc in __getitem__(self, i)
    939             10
    940         """
--> 941         return self.function(i)
    942
    943     def __getstate__(self):

/Applications/sage/local/lib/python2.6/site-packages/sage/combinat/
combinat.pyc in __call__(self, x)
   1013             return self._element_constructor_(x)
   1014         else:
-> 1015             raise ValueError, "%s not in %s"%(x, self)
   1016
   1017     Element = CombinatorialObject # mostly for backward
compatibility

ValueError: 0 not in Partitions


Is this expected?

--
John

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to