File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
name = " SymPy"
2
2
uuid = " 24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
3
- version = " 1.0.22 "
3
+ version = " 1.0.23 "
4
4
5
5
6
6
[deps ]
Original file line number Diff line number Diff line change 19
19
\ (x:: SymbolicObject , y:: SymbolicObject ) = (y' / x' )' # ?
20
20
21
21
inv (x:: Sym ) = x. __pow__ (Sym (- 1 ))
22
+
23
+ # special case Boolean; issue 351
24
+ # promotion for Boolean here is to 0 or 1, not False, True
25
+ + (x:: Bool , y:: SymbolicObject ) = Sym (Int (x)). __add__ (y)
26
+ + (x:: SymbolicObject , y:: Bool ) = x. __add__ (Int (y))
27
+ * (x:: Bool , y:: SymbolicObject ) = Sym (Int (x)). __mul__ (y)
28
+ * (x:: SymbolicObject , y:: Bool ) = x. __mul__ (Int (y))
29
+ - (x:: Bool , y:: SymbolicObject ) = Sym (Int (x)). __sub__ (y)
30
+ - (x:: SymbolicObject , y:: Bool ) = x. __sub__ (Int (y))
31
+ / (x:: Bool , y:: SymbolicObject ) = Sym (Int (x)). __div__ (y)
32
+ / (x:: SymbolicObject , y:: Bool ) = x. __div__ (Int (y))
33
+ ^ (x:: Bool , y:: SymbolicObject ) = Sym (Int (x)). __pow__ (y)
34
+ ^ (x:: SymbolicObject , y:: Bool ) = x. __pow__ (Int (y))
Original file line number Diff line number Diff line change 608
608
@test eltype (A* A) == Sym
609
609
@test eltype (A* ones (2 ,2 )) == Sym
610
610
@test eltype (A* Diagonal ([1 ,1 ])) == Sym
611
- @test_broken eltype (A * I (2 )) == Sym
611
+ VERSION >= v " 1.2.0 " && @test eltype (A * I (2 )) == Sym
612
612
613
613
# # Issue 328 with E -> e
614
614
@vars x
654
654
@test lambdify (PI^ 4 * xreal)(256 ) == 256 * pi ^ 4
655
655
656
656
657
-
657
+ # # Issue 351 booleans and arithmetic operations
658
+ @test 1 + true == 2 == true + 1
659
+ @test 1 - true == 0 == true - 1
660
+ @test 1 * true == 1 == true * 1
661
+ @test 1 / true == 1 == true / 1
662
+ @test true ^ 1 == 1 == 1 ^ true
658
663
659
664
end
You can’t perform that action at this time.
0 commit comments