Status: Accepted Owner: smichr Labels: Type-Defect Priority-Medium
New issue 1980 by smichr: has, has_any_symbols, has_all_symbols unified http://code.google.com/p/sympy/issues/detail?id=1980 Inspired by the introduction of has_(any|all)_symbols, has() was re-written to try quickly answer the question of whether an expression has a given atom, BasicType, or pattern. The speed of has() now is competitive with the specialized versions of the same so the specialized forms were removed. It is now no longer necessary (or desirable) to use atoms to answer whether an expression has a Symbol (for example) by checking whether atoms(Symbol) contains anything; a call like expr.has(Symbol) will be much faster at answering that question. atoms() should be used to return a collection of atoms; has() should be used to inquire whether certain patterns are present. Note: the old has_(any|all)_symbols always returned True when there was no pattern; there were no existing tests that required that behavior so, for sake of future work which will depend on getting False, has() will always return False if there are not patterns. -- 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.
