Skip to content

Commit 053f40e

Browse files
committed
Clarify handling of script metadata
1 parent e0c56aa commit 053f40e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎source/specifications/inline-script-metadata.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ and the regular expression, the text specification takes precedence.
7070
Tools MUST NOT read from metadata blocks with types that have not been
7171
standardized by this specification.
7272

73+
Note that the specification only requires that *top-level* comment blocks are
74+
recognised as containing metadata. However, parsing Python code is non-trivial,
75+
and therefore:
76+
77+
* Tools MAY choose to do a simple textual scan, rather than a full Python parse.
78+
For example, the canonical regular expression provided above does a textual
79+
scan.
80+
* As a result of the previous point, the behaviour of scripts that contain data
81+
that looks like metadata within another Python construct such as a multi-line
82+
string is tool-dependent and should not be relied on.
83+
7384
script type
7485
-----------
7586

0 commit comments

Comments
 (0)