Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion source/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,20 @@ this_list:
key4: value4
```

In a lattice file, an ordered list of key-value pairs can always be used in place of a dictionary
with the restriction that no duplicate keys can be present in the list.
For example, the above dictionary written as a list would look like:
```{code} yaml
this_dictionary:
- key1: value1
- key2: value2
- key3: value3
```
Comment thread
DavidSagan marked this conversation as resolved.
The reverse -- using a dictionary in place of a list -- in general
is not allowed since order may be important and lists may have duplicate entries.

```{note}
Developer note:
Code Developer note:
PALS dictionaries should, when possible, implement a dictionary that preserves insertion order.

While not strictly necessary, this helps with human readability:
Expand Down