From b7e4c9dd67c0a4e7f1d93dd13b1fd32efbc24f28 Mon Sep 17 00:00:00 2001 From: jw9829 <245427686+jw9829@users.noreply.github.com> Date: Sat, 26 Sep 2026 23:45:43 -0400 Subject: [PATCH] Recommend handling metadata-like strings --- source/specifications/inline-script-metadata.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/specifications/inline-script-metadata.rst b/source/specifications/inline-script-metadata.rst index f9df2f0f5..0b75d6956 100644 --- a/source/specifications/inline-script-metadata.rst +++ b/source/specifications/inline-script-metadata.rst @@ -219,6 +219,21 @@ Tools that support managing different versions of Python should attempt to use the highest available version of Python that is compatible with the script's ``requires-python`` metadata, if defined. +If a string literal contains lines that look like inline metadata, a simple +textual scan may mistake them for metadata. Put the opening marker inside a +quoted line; Python joins adjacent string literals: + +.. code:: python + + source_code = (""" + """ + "# /// script" + """ + # dependencies = ["requests"] + # /// + import requests + """) + History =======