We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The value of a key from a Dict object has the expected type
julia> d = Dict{Int, Bool}() Dict() julia> for i in 1:5 d[i] = true end julia> typeof(d[1]) Bool
but a comprehension of those values is always an Any Array
julia> [d[k] for k in keys(d)] 5-element Any Array: true true true true true
Is there a way to create a comprehension like the above producing a Bool Array?
The text was updated successfully, but these errors were encountered:
julia> [d[k]::Bool for k in keys(d)]
Sorry, something went wrong.
Thanks, Mike. The reason for my posing this as an issue is because it seems to me that getting the correct type, rather than Any, should be automatic.
(Earlier I wrote Nick instead of Mike forgetting that the reason the name Nick Nolta sounded familiar is because he is an actor.)
eccf3c5
Note: #524 is still a problem here.
fix JuliaLang#1043
9fd7bdd
No branches or pull requests
The value of a key from a Dict object has the expected type
but a comprehension of those values is always an Any Array
Is there a way to create a comprehension like the above producing a Bool Array?
The text was updated successfully, but these errors were encountered: