Skip to content

Type piracy? #25

@dpo

Description

@dpo

We're having an issue using Julia from the Juno REPL (which imports OrderedCollections), in which sort() of a Dict returns an OrderedDict even though the user didn't import OrderedCollections. The unexpected behavior is described here:

https://discourse.julialang.org/t/juno-repl-behaves-differently-than-terminal-repl/29469/2

The culprit appears to be :

julia> d = Dict(1 => "a", 3 => "b", 0 => "c")
Dict{Int64,String} with 3 entries:
  0 => "c"
  3 => "b"
  1 => "a"

julia> sort(d)
OrderedCollections.OrderedDict{Int64,String} with 3 entries:
  0 => "c"
  1 => "a"
  3 => "b"

julia> @which sort(d)
sort(d::Dict) in OrderedCollections at /Users/dpo/.julia/packages/OrderedCollections/E21Rb/src/dict_sorting.jl:21

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions