Skip to content

Document how are dictionaries added #6895

@YDX-2147483647

Description

@YDX-2147483647

Description

I want to explicitly document how are dictionaries added.
Specifically, values in the second dictionary will override values in the first one, but the order of keys is kept.
For example, (a: 1, b: 2) + (a: 3) is (a: 3, b: 2), not (a: 1, b: 2) or (b: 2, a: 3).
See IndexMap::extend in indexmap::map - Rust.

Besides, maybe add a link from dictionary.insert.

Discord:

Dictionaries guarantee insertion order

At present, it looks like the following sentence is the only documentation. And there's no test for + and join.

/// access the value. Dictionaries can be added with the `+` operator and
/// [joined together]($scripting/#blocks). To check whether a key is present in

A bit relates to #1258.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions