Comment #1 on issue 1577 by [email protected]: match doesn't put every wild as a key http://code.google.com/p/sympy/issues/detail?id=1577
You've probably solved the problem by now but I disagree with your reasoning. You want to do something if n != 1, but do you mean to do it if n cannot possibly be 1, or if n can be different from 1? In your case, it's the latter but both scenarios can arise. Therefore, it's the responsibility of the users of match() to specify the behaviour of their algorithms, which is easily done: in your case, you can use 'if n not in r and r[n] != 1: ...' or the more compact (and cryptic) 'if r.get(n, 0) != 1: ...' I think everything is WAD here. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en -~----------~----~----~----~------~----~------~--~---
