-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to assign Matrix expressions to N or Q fails #141
Comments
yes,if we use N at first its not giving any error,later its giving error
|
after these lines i have used |
i would like to work towards it ,can someone help me.. |
I guess it doesn't handle redefining names that are built in to SymPy correctly. |
Just tested, and It's not just for This fails: >>> def Z(x):
return 42
>>> Z = Matrix([1,2,3]) so it's when left side of assignment is function-like, and right is Matrix |
While browsing this page in the docs, I saw that trying to assign a
Matrix
object toN
fails.clickable
Interestingly if you try to assign something simpler like
2
or2*x
it works:and also after the initial assignment, you can assign the Matrix expression to
N
w/o a problem:So it seems there is some issue only when parsing the initial assignment statement
N = Matrix([0, 1, 1])
whenN
is the builtin function.Further testing
I tried some of the other one-letter builtins and these work fine:
But
Q
fails the same way asN
:Even more weirdness
Trying to define a regular Python function called
N
whenN
is currently defined as a Matrix fails:clickable
When
N
is a regular int, defining a function works of courseSummary
It seems some part of the live shell wrapper logic is trying to parse inputs and simpify them, which works in general, but is causing bad interactions when either the left or the right side of assignment statements are
Matrix
objects.The text was updated successfully, but these errors were encountered: