Skip to content

Commit 4dcf6d3

Browse files
jw9829henryiii
authored andcommitted
Recommend handling metadata-like strings
1 parent 6a46e99 commit 4dcf6d3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,21 @@ Tools that support managing different versions of Python should attempt to use
219219
the highest available version of Python that is compatible with the script's
220220
``requires-python`` metadata, if defined.
221221

222+
If a string literal contains lines that look like inline metadata, a simple
223+
textual scan may mistake them for metadata. Put the opening marker inside a
224+
quoted line; Python joins adjacent string literals:
225+
226+
.. code:: python
227+
228+
source_code = ("""
229+
"""
230+
"# /// script"
231+
"""
232+
# dependencies = ["requests"]
233+
# ///
234+
import requests
235+
""")
236+
222237
223238
History
224239
=======

0 commit comments

Comments
 (0)