Thanks!

On Wednesday, April 13, 2016 at 7:08:37 PM UTC+2, Aaron Meurer wrote:
>
> sympy.Function is absolutely designed to be subclassed. 
>
> If f = Function('f'), then f is a subclass of UndefinedFunction, and 
> f(x) is an instance of AppliedUndef (both can be imported from 
> sympy.core.function). You can find custom functions with 
> y.atoms(AppliedUndef). 
>
> Aaron Meurer 
>
>
> On Wed, Apr 13, 2016 at 8:35 AM, Nico <[email protected] <javascript:>> 
> wrote: 
> > To get all function from an expression, one can do 
> > ``` 
> > from sympy import * 
> > 
> > f = Function('f') 
> > x = Symbol('x') 
> > y = f(x) + 2 * sin(x) 
> > 
> > for fun in y.atoms(Function): 
> >     print(fun.func) 
> > ``` 
> > which in this case will print out `f` and `sin`. 
> > 
> > I would now like to distinguish between function that I defined myself 
> (`f`) 
> > the ones that come from elsewhere. I though about subclassing 
> > `sympy.Function`, but apparently it's not exactly meant to be used that 
> way 
> > [1]. 
> > 
> > Any hints? 
> > 
> > Cheers, 
> > Nico 
> > 
> > 
> > [1] https://groups.google.com/forum/#!topic/sympy/pU81Trc_Xr8 
> > 
> > -- 
> > 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] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at https://groups.google.com/group/sympy. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/sympy/4c4c052e-7b95-4661-9356-b21fc0a271b0%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/5b0da0fe-a454-404d-9857-056f62d46c91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to