In  https://github.com/sympy/sympy/pull/1314 the behavior of Tuple is being 
changed wrt how the method 'has' applies to it. If an arg to 'has' is 
non-Basic, e.g. a bool or Function('f'), then the 'has' result will be 
False. The rationale is that has checks things that should only contain 
Basic objects. The problem is that presently Tuple will hold any 
sympifiable object. So Tuple(Function('f')).has(f) will return False after 
the changes but currently returns True. (The case of Tuple(None).has(None) 
raises an error in master because None does not have the is_Add attribute. 
In the proposed changes, it will fail with "AttributeError: 'NoneType' 
object has no attribute '_has_matcher'."

Eventually I think bool will become a Bool object in SymPy and then has 
will work with Bool (if it's a Basic object); but functions like 'f' are 
not Basic but they are a sympy object and although we don't currently put 
them in Tuple anywhere, I don't think it would be unreasonable to have them 
there and then I think has should work with them.

So is there a good reason to either a) not have f be Basic or b) not let 
Tuple hold functions like f (and not discriminate against them in a has 
query)?

/c

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/6OX0wb5LMjMJ.
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?hl=en.

Reply via email to