It doesn't always make sense to delegate these properties to the
subexpressions of a Piecewise. For example knowing that the
subexpressions are hypergeometric functions does not mean that the
piecewise itself is a hypergeometric function.

On Fri, 21 Feb 2020 at 13:28, Chris Smith <[email protected]> wrote:
>
> In #18696 there is a problem of having `Piecewise(...).is_hypergeometric` 
> return True when all the expressions it contains are hypergeometric. Quoting 
> from my comment there:
>
>> The `is_hypergeometric` function has to be made to look for a `Piecewise` 
>> and return True if all the expressions in the `Piecewise` are 
>> hypergeometric. But better, `Piecewise` should be able to respond to all 
>> `is_what` requests by returning a value based on all its args meeting that 
>> criteria. `Piecewise` already knows how to handle a rewrite request (e.g. 
>> `Piecewise((factorial(x),x>0),(1,True)).rewite(gamma)` works. I believe the 
>> `core.basic.rewrite` and `core.basic._eval_rewrite` are able to work out how 
>> to rewrite the args of Piecewise without Piecewise having all 
>> `_eval_rewrite_as_what`. It would be good if we could do the same thing for 
>> all `is_what` properties.
>
>
> What would be the best way to get Piecewise to do this?
>
> /c
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/7223afaf-b89e-4dde-bf46-c7a1e3949e70%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSOs%3DvpA-tHAVegYXjZ236c8mhGkTYYzkpoPCucrfyiTA%40mail.gmail.com.

Reply via email to