-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Support for symbolics in the list data structure (#2368)
- Loading branch information
1 parent
ac65227
commit 9b5f52f
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from sympy import Symbol, sin, pi | ||
from lpython import S | ||
|
||
def test_extraction_of_elements(): | ||
x: S = Symbol("x") | ||
l1: list[S] = [x, pi, sin(x), Symbol("y")] | ||
ele1: S = l1[0] | ||
ele2: S = l1[1] | ||
ele3: S = l1[2] | ||
ele4: S = l1[3] | ||
|
||
assert(ele1 == x) | ||
assert(ele2 == pi) | ||
assert(ele3 == sin(x)) | ||
assert(ele4 == Symbol("y")) | ||
print(ele1, ele2, ele3, ele4) | ||
|
||
test_extraction_of_elements() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters