I really like the evaluate=False flag on parse_expr.  But, since log(0.1) 
automatically evaluates to a float, I'm trying to create an unevaluated 
version of log.  However, I'm getting strange results where log is 
implicitly defined.  

As shown below, once I define a function log that does nothing, sympy 
somehow implicitly defines it to be the usual log function.

Am I missing how this works or is this aberrant behavior?

My eventual plan is to have log.doit() return the original sympy function.

If I call the function something else, like llog, then I don't run into the 
behavior.  But, I'm not sure how to make printers display my llog function 
as log.

Thanks,
Duane



In [1]: from sympy import Function

In [2]: log
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-9a115ebc25a0> in <module>()
----> 1 log

NameError: name 'log' is not defined

In [3]: class log(Function):
   ...:     pass
   ...: 

In [4]: log
Out[4]: __main__.log

In [5]: log(0.1)
Out[5]: -2.30258509299405

-- 
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 http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/5df457b7-7ffc-4285-b9b5-b8ddce3f91ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to