Dictionary shorthand¶
Info
New in Atfinity 17.
Description¶
Inside any dictionary literal, a bare identifier desugars to key: 'key'. That is, writing just the name of the key uses the same name (as a string) for the value.
This shorthand works in every dictionary literal, not only as the argument to to_dict.
You can freely mix shorthand entries with explicit key: value entries within the same dictionary.
Examples¶
Mixing shorthand and explicit values: