We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfe45e8 commit 69e73ffCopy full SHA for 69e73ff
1 file changed
src/pals/kinds/mixin/all_element_mixin.py
@@ -61,7 +61,14 @@ def unpack_element_list_structure(
61
f"but we got {item!r}"
62
)
63
name, fields = list(item.items())[0]
64
+ # Allow a shorthand usage: `- use: element_name` in examples.
65
+ # If the value is not a dict but the key is 'use', treat it as
66
+ # a reference to an existing element name and wrap it in a
67
+ # PlaceholderName so downstream code can resolve it.
68
if not isinstance(fields, dict):
69
+ if name == "use" and isinstance(fields, str):
70
+ new_list.append(PlaceholderName(fields))
71
+ continue
72
raise TypeError(
73
f"Value for element key {name!r} must be a dict (the element's properties), "
74
f"but we got {fields!r}"
0 commit comments