Skip to content
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

Wrong output when composing length() with values() for Dictionaries #26421

Closed
AzamatB opened this issue Mar 12, 2018 · 1 comment
Closed

Wrong output when composing length() with values() for Dictionaries #26421

AzamatB opened this issue Mar 12, 2018 · 1 comment

Comments

@AzamatB
Copy link
Contributor

AzamatB commented Mar 12, 2018

Consider the following code:

julia> num_dict = Dict(1 => IntSet(1:2), 2 => IntSet(1:3))
Dict{Int64,IntSet} with 2 entries:
  2 => IntSet([1, 2, 3])
  1 => IntSet([1, 2])

julia> length(values(num_dict))
2

julia> length.(values(num_dict))
2

julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b (2017-06-19 13:05 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

It seems erroneous to me that in this case length.(values(num_dict)) returns 2 instead of a vector with 3 and 2 as it's elements.

@JeffBezanson
Copy link
Sponsor Member

Duplicate of #18618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants