Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Status: Accepted Owner: smi...@gmail.com Labels: Type-Defect Priority-Medium EasyToFix New issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 Dict and Set should compare the same regardless of order that args are input. This

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #1 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 I'm running into a lot of attribute problems with these containers: Why doesn't tuple Sort nicely? sorted([Tuple(1,2),Tuple(3,2)]) [(1, 2), (3, 2)]

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #2 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 Dict doesn't sort: sorted([Dict((1,2)),Dict((2,1))]) [{2: 1}, {1: 2}] sorted(reversed([Dict((1,2)),Dict((2,1))]) [{2: 1}, {1: 2}] -- You

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #3 on issue 2689 by christian.muise: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 Why not overload equality, and check every element in one is in the other (and vice versa)? -- You received this message because you are subscribed to the

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #4 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, I have the basics defined (__eq__, __cmp__, __iter__ and sort the args) so now: args = [(1,2),(2,1)] for o in [Dict, Tuple, Set]: ... if

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
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

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Updates: Labels: smichr NeedsReview Comment #6 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 https://github.com/sympy/sympy/pull/604 -- You received this message because you are subscribed to the Google

Re: Issue 2654 in sympy: lambdify() does not convert abs()

2011-09-16 Thread sympy
Comment #3 on issue 2654 by asmeurer: lambdify() does not convert abs() http://code.google.com/p/sympy/issues/detail?id=2654 Does the built-in abs() not work correctly? That would have been what was happening before. -- You received this message because you are subscribed to the Google

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #7 on issue 2689 by asmeurer: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 for a Set (which is not a python-like set() in that it can contain duplicate) When can this happen? This shouldn't be the case for a mathematical set. -- You

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #8 on issue 2689 by ronan.l...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 When can this happen? This shouldn't be the case for a mathematical set. ProductSet(Interval(0, 1), Interval(0, 1)) -- You received this message

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #9 on issue 2689 by ronan.l...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 More generally, Set doesn't mean at all what you think it means: it's a base class for all symbolic objects representing sets (e.g. Interval,

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #10 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 Set(1, 1, 2, 3) -- You received this message because you are subscribed to the Google Groups sympy-issues group. To post to this group, send email to

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #11 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 I've had my head in combinations today...right now a set looks like a collection of items and so when I see sympy's Set I think that it should behave like

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #13 on issue 2689 by asmeurer: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 So what does Set(1, 2) mean then? -- You received this message because you are subscribed to the Google Groups sympy-issues group. To post to this group, send email

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #14 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 I'm leaving Set alone. Ronan's comments have helped clear up the confusion and I left a breadcrumb in the docstring to help someone else stay away from

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #15 on issue 2689 by asmeurer: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 So should Set by imported by from sympy import *? That seems like it would lead to confusion. Actually, what should be our policy on importing base classes and

Re: Issue 2689 in sympy: Set and Dict args should be sorted

2011-09-16 Thread sympy
Comment #16 on issue 2689 by smi...@gmail.com: Set and Dict args should be sorted http://code.google.com/p/sympy/issues/detail?id=2689 Well, I got stung by it today. I think it would have been better to not load the base class. Also, re what Set(1,2) means...it means that Set is a Basic

Re: Issue 1475 in sympy: New implementation of .eval in trigonometric functions, implementing sec, csc

2011-09-16 Thread sympy
Comment #7 on issue 1475 by someb...@bluewin.ch: New implementation of .eval in trigonometric functions, implementing sec, csc http://code.google.com/p/sympy/issues/detail?id=1475 I'm currently working on this and will finish a first version of all missing trigonometric and hyperbolic