Comment #5 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted
http://code.google.com/p/sympy/issues/detail?id=2689

OK, now it's working. I wanted to have the multiset_partitions to be
turned into a set to show only the unique permutations:

    >>> from sympy.utilities.iterables import *
    >>> m=list(multiset_partitions([1,1,2],2))
    >>> m
    [[[1, 1], [2]], [[1], [1, 2]], [[1, 2], [1]]]
    >>> mdict = [Dict(*[(g[0], len(g)) for g in group(j)]) for j in li
for li in m]
    >>> mdict
    [{1: 1, 2: 1}, {1: 1, 2: 1}, {1: 1, 2: 1}, {1: 1}, {1: 1}, {1: 1}]
    >>> Tuple(*[Set(*m_dict) for li in m])
(Set({1: 2}, {2: 1}), Set({1: 1}, {1: 1, 2: 1}), Set({1: 1}, {1: 1, 2: 1}))
    >>> set(_)
    set([Set({1: 1}, {1: 1, 2: 1}), Set({1: 2}, {2: 1})])

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to