why doesn't x(1) complain?

1 view
Skip to first unread message

smichr

unread,
Nov 24, 2009, 10:12:24 PM11/24/09
to sympy
The following does not complain:

###
>>> var('x')
x
>>> x(1)
x(1)
###

I wish this would raise an error... If x isn't a function, what
meaning would x(1) have? One problem with no warning being given is
that if you import everything from symp.abc as in "from symp.abc
import *" you will wipe out S and N as special sympy classes. Then,
because S(1) will not complain about not being a function,
calculations will proceed but S(1) will not behave like S.One.

Perhaps there's a good reason for this behavior...just wondering what
it might be.

Ronan Lamy

unread,
Nov 24, 2009, 11:25:34 PM11/24/09
to sy...@googlegroups.com
I was thinking of implementing something a bit like that for issue 1680,
but I find this confusing as well.
There's some discussion related to the topic in issue 282
( http://code.google.com/p/sympy/issues/detail?id=282 ).

Ondrej Certik

unread,
Nov 25, 2009, 4:07:25 AM11/25/09
to sy...@googlegroups.com
I agree that it is confusing and I think we should to something to fix it.

Ondrej
Reply all
Reply to author
Forward
0 new messages