Skip to content

Commit 7d77edb

Browse files
committed
Improve comment on new 'use' syntax
1 parent ed6f59c commit 7d77edb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/pals/kinds/mixin/all_element_mixin.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ def unpack_element_list_structure(
6161
f"but we got {item!r}"
6262
)
6363
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.
64+
# In addition to the existing shorthand `- element_name`
65+
# (a plain string reference), also allow the alternative
66+
# reference syntax `- use: element_name`.
67+
# If the value is not a dict but the key is 'use',
68+
# treat it as a reference to an existing element name
69+
# and wrap it in a PlaceholderName so downstream code
70+
# can resolve it.
6871
if not isinstance(fields, dict):
6972
if name == "use" and isinstance(fields, str):
7073
new_list.append(PlaceholderName(fields))

0 commit comments

Comments
 (0)