Skip to content

Commit f85ba11

Browse files
authored
close #561 (#562)
* fix set conversion * version bump
1 parent b2a9d42 commit f85ba11

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SymPy"
22
uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
3-
version = "2.3.2"
3+
version = "2.3.3"
44

55
[deps]
66
CommonEq = "3709ef60-1bee-4518-9f2f-acd86f176c50"

src/python_connection.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ SymPyCore.:↓(x::Set) = _sympy_.sets.FiniteSet((↓(xi) for xi ∈ x)...)
4646
SymPyCore.:(::Type{<:AbstractString}, x) = Sym(PyObject(x))
4747
SymPyCore.:(::Type{<:Bool}, x) = Sym(x)
4848

49-
function SymPyCore.:(::Type{PyCall.PyObject}, x)
49+
_Set(x) = Set(x)
50+
_Set(xs...) = Set(xs)
51+
function SymPyCore.:(u::Type{PyCall.PyObject}, x)
5052
# check if container type
5153
# pybuiltin("set") allocates, as PyObject does
52-
pyisinstance(x, _pyset_) && return Set(collect(Sym, x))
54+
pyisinstance(x, _pyset_) && return _Set(collect(map(Sym, x))...)
5355
pyisinstance(x, _pytuple_) && return Tuple((xᵢ) for xᵢ x)
5456
pyisinstance(x, _pylist_) && return [(xᵢ) for xᵢ x]
5557
pyisinstance(x, _pydict_) && return Dict((k) => (x[k]) for k x)

0 commit comments

Comments
 (0)