Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppliedUndef.is_number = False #13619

Merged
merged 2 commits into from
Nov 19, 2017
Merged

AppliedUndef.is_number = False #13619

merged 2 commits into from
Nov 19, 2017

Conversation

smichr
Copy link
Member

@smichr smichr commented Nov 17, 2017

This PR changes is_number behavior and AccumBound.contains error handling

b: f(1).is_number is now False when f is an AppliedUndef; the former foo.is_number is now equivalent to not foo.free_symbols. is_number is generally used to detect expressions that might be evaluated.
m: AccumBounds.contains only raises an error if the condition is unevaluated

  • is_number now is only True for something that will evaluate to a number (though it may not do so with precision).
  • is_comparable (for reference) is only True if something is a number and evaluates with precision
  • The contains method of AccumBounds was overly optimistic since something being a number does not guarantee that the condition tested will be evaluated. An error is now raised if the condition is not evaluated and the and separating args in the And was changed to a comma: And(c1, c2) not And(c1 and c2).

fixes #5033
fixes #6646

@smichr smichr changed the title Isnum AppliedUndef.is_number = False Nov 17, 2017
@smichr smichr merged commit 50d8a10 into sympy:master Nov 19, 2017
@smichr smichr deleted the isnum branch November 19, 2017 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined functions with number arguments should have is_number be False Function.is_number oddness
1 participant