Comment #3 on issue 1577 by ronan.l...@gmail.com: match doesn't put every wild as a key http://code.google.com/p/sympy/issues/detail?id=1577
""but do you mean to do it if n cannot possibly be 1, or if n can be different from 1?" Maybe it is too early in the morning, but these sound like the same thing to me. Can you clarify? " In this case, we have 'if not (n in r and r[n] == 1): do_stuff()'. In other situations, we could have 'if n in r and (not r[n] == 1): do_stuff()' - and then returning None provides no benefit. Clearer? Anyway, the best argument against your proposal is that the return value of match/matches is meant to be used as a replacement dictionary in subs and we should always have pattern.subs(pattern.matches(expr)) == expr when there is a match. Returning None in the dictionary would require handling expressions such as Pow(f(x), None) and would prevent matching expressions containing wilds (example: (w1 + w2).matches(x+w2) ) -- 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 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 -~----------~----~----~----~------~----~------~--~---