We don't have support for that exact syntax, because it doesn't make
sense (with it, f is both a function and the evaluation of itself,
i.e., f == f(x)). You could probably emulate it by writing a custom
class with minimal code, though.
If you want the more reasonable syntax f(x).diff(x), just define a
Python function
>>> def f(y):
... return (100 - 2*x).subs(x, y)
...
>>> f(2)
96
>>> f(x).diff(x)
-2
lambdify is designed for efficient evaluation using numpy. If you are
only evaulating at a couple of points, or you still want to use the
output with SymPy, just use a Python function.
For completeness, other options are implemented_function and
subclassing Function. These are useful if you want the function to
remain unevaluated for some inputs. implemented_function is designed
to be used in conjunction with lambdify. Subclassing Function lets
you write arbitrary code (in the eval method) to decide when the
function becomes evaluated or not (not evaluating means it is just
left as symbolic f(x)).
Aaron Meurer
> --
> 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/-/i0oibTlceh4J.