Is there an equivalent to Mathematica's “use” function?

In Mathematicy, you can define function tags, such as

f::usage = "f[x] gives (x - 1)(x + 1)"; 

which can then be called as:

 ?f 

Is there an equivalent in sympy?

0
source share
1 answer

You can "decapitate" the tool as follows:

 import sympy f = sympy.Function("f") f.__doc__ = "A naked function without any special properties" 

You can get the tool in the same way, for example, print(f.__doc__) . In iPython, etc. Can you also use f? to receive it (along with other information).

+2
source

Source: https://habr.com/ru/post/1271470/


All Articles