A key/value collection that keeps insertion order and can be read or updated during script execution.
Syntax
dict(mapping_or_pairs=(), /, **items)
Parameters
None
Returns
dict
Behavior / side effects
A key/value collection that keeps insertion order and can be read or updated during script execution.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Create an empty dictionary, copy a mapping or iterable of pairs, or build entries from keyword arguments.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Create a dictionary with string, number, boolean, or object values.
Syntax
{"mode": "farm", "retries": 3}
Parameters
Name
Description
keyString
dict key.
Required · Positional or named
No default
valueAny?
Value stored for that key.
Required · Positional or named
No default
Returns
dict — A new dictionary that preserves the literal entry order.
Behavior / side effects
Create a dictionary with string, number, boolean, or object values.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Build a dictionary from an iterable while preserving insertion order.
Syntax
{key: value for target in iterable if condition}
Parameters
Name
Description
keyAny
dict key calculated for each accepted item.
Required · Positional or named
No default
valueAny?
Value stored for that key.
Required · Positional or named
No default
targetName | destructuring target
Loop target for the current item. Starred targets are not supported.
Required · Positional or named
No default
iterableIterable
Source values to loop through.
Required · Positional or named
No default
conditionBoolean
Optional filter checked before storing an entry.
Optional · Positional only
Default:True
Returns
dict — A new mutable dictionary.
Behavior / side effects
Build a dictionary from an iterable while preserving insertion order. Multiple for/if clauses are supported.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Example
pairs = [("mode", "farm"), ("retries", 3)]
settings = {key: value for key, value in pairs}
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Any? — The stored value for that key, or None when the key is absent.
Behavior / side effects
Read one value by key. Missing keys return None.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Write or replace one key/value entry with bracket assignment syntax.
Syntax
dictionary[key] = value
Parameters
Name
Description
dictionarydict
The mutable dictionary to update.
Required · Positional or named
No default
keyAny
Key to write or replace.
Required · Positional only
No default
valueAny?
Value to store for that key.
Required · Positional only
No default
Returns
None — No direct return value. The dictionary is updated in place.
Behavior / side effects
Write or replace one key/value entry with bracket assignment syntax.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Count how many key/value pairs are in the dictionary.
Syntax
len(dictionary, /)
Parameters
Name
Description
dictionarydict
The dictionary to count.
Required · Positional only
No default
Returns
Int — Number of entries in the dictionary.
Behavior / side effects
Count how many key/value pairs are in the dictionary.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Read a value by key and optionally fall back to a default.
Syntax
dictionary.get(key, default=None, /)
Parameters
Name
Description
keyAny
Key to look up.
Required · Positional only
No default
defaultAny?
Fallback value returned when the key is missing.
Optional · Positional only
Default:None
Returns
Any? — The stored value for that key, or the provided default.
Behavior / side effects
Read a value by key and optionally fall back to a default.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Get key/value pairs as a list of two-item tuples in insertion order.
Syntax
dictionary.items()
Parameters
None
Returns
list — A list of (key, value) tuples.
Behavior / side effects
Get key/value pairs as a list of two-item tuples in insertion order.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Remove one key and return its value, or return the default when missing.
Syntax
dictionary.pop(key, default=None, /)
Parameters
Name
Description
keyAny
Key to remove.
Required · Positional only
No default
defaultAny?
Fallback returned when the key is missing.
Optional · Positional only
Default:None
Returns
Any? — Removed value or fallback default.
Behavior / side effects
Remove one key and return its value, or return the default when missing.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Copy the dictionary into a new mutable dictionary.
Syntax
dictionary.copy()
Parameters
None
Returns
dict — A new dictionary with the same entries.
Behavior / side effects
Copy the dictionary into a new mutable dictionary.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Update this dictionary from another mapping, pairs iterable, and keyword entries.
Syntax
dictionary.update(other=(), /, **items)
Parameters
Name
Description
otherdict | Iterable
Mapping or pairs to merge.
Optional · Positional only
Default:None
itemsAny?
Keyword entries to write.
Optional · Variadic
No default
Returns
None — No direct return value. The dictionary is updated in place.
Behavior / side effects
Update this dictionary from another mapping, pairs iterable, and keyword entries.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Return an existing value, or store and return the default when the key is missing.
Syntax
dictionary.setdefault(key, default=None, /)
Parameters
Name
Description
keyAny
Key to read or create.
Required · Positional only
No default
defaultAny?
Value stored when the key is absent.
Optional · Positional only
Default:None
Returns
Any? — Existing value or inserted default.
Behavior / side effects
Return an existing value, or store and return the default when the key is missing.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Get the dictionary keys as a list in insertion order.
Syntax
dictionary.keys()
Parameters
None
Returns
list — A list of keys.
Behavior / side effects
Get the dictionary keys as a list in insertion order.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Get the dictionary values as a list in insertion order.
Syntax
dictionary.values()
Parameters
None
Returns
list — A list of values.
Behavior / side effects
Get the dictionary values as a list in insertion order.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
None — No direct return value. The dictionary becomes empty.
Behavior / side effects
Remove every key/value pair from the dictionary.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Loop through dictionary keys in the same order they were written in the literal.
Syntax
for key in dictionary:
Parameters
Name
Description
keyAny
Current key inside the loop.
Required · Positional or named
No default
dictionarydict
The dictionary to iterate.
Required · Positional or named
No default
Returns
None — No direct return value. The loop runs once per key.
Behavior / side effects
Loop through dictionary keys in the same order they were written in the literal.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Example
settings = {"mode": "farm", "retries": 3}
for key in settings:
text(str(settings[key])) # returns None
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.
Check whether the dictionary has at least one entry.
Syntax
if dictionary | if not dictionary
Parameters
Name
Description
dictionarydict
The dictionary used in the condition.
Required · Positional or named
No default
Returns
Boolean condition — true when the dictionary is not empty, false when it is empty.
Behavior / side effects
Check whether the dictionary has at least one entry. An empty dictionary is treated as false.
Execution
Blocking: No
Thread safety: Use separate objects per flow
Parallel execution: Yes
Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.
Example
settings = {}
if not settings:
text("No settings") # returns None
Errors / limitations
No additional limitations documented; follow the parameter and behavior contract above.