You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using IterTools
julia>collect(subsets((0,2,6), 2))
ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64,Int64} to an object of type Array{Int64,1}
...
Stacktrace:
[1] setindex!(::Array{Array{Int64,1},1}, ::Tuple{Int64,Int64}, ::Int64) at ./array.jl:767
[2] copyto!(::Array{Array{Int64,1},1}, ::IterTools.Binomial{Tuple{Int64,Int64,Int64}}) at ./abstractarray.jl:671
[3] _collect at ./array.jl:550 [inlined]
[4] collect(::IterTools.Binomial{Tuple{Int64,Int64,Int64}}) at ./array.jl:544
[5] top-level scope at none:0
This works though:
julia>collect(x for x insubsets((0,2,6), 2))
3-element Array{Tuple{Int64,Int64},1}:
(0, 2)
(0, 6)
(2, 6)
Julia 1.1
IterTools 1.3
The text was updated successfully, but these errors were encountered:
Is this a bug in IterTools?
This works though:
Julia 1.1
IterTools 1.3
The text was updated successfully, but these errors were encountered: