01 / Reproduce
Reproduce the shared edit
Download the practice ZIP and extract it into a fresh folder. It contains check-variants.py, prompt-template.json and a README. With Python 3.10 or newer installed, open PowerShell in that folder. No packages need to be installed.
python --version
python .\check-variants.py
Get-Content -LiteralPath .\lab-output\report.json
The fictional template has a system instruction, a user message about workshop notes, and metadata.review_tags, initially an empty list. In every case the script changes A's instruction to five bullets and appends edited-A to A's tags. It then inspects B and the template. Our observed console output was:
Python 3.13.15 / 5 authored cases passed / no model calls
outer_copy: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=false
message_list_copy: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=false
message_dict_copies: B="Reply in 3 bullets."; B tags=["edited-A"]; template unchanged=false
deepcopy_each: B="Reply in 3 bullets."; B tags=[]; template unchanged=true
deepcopy_batch: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=true
Report: lab-output\report.json
Open the report beside the JSON input. It includes complete A, B and template snapshots for each case, object-identity checks, the input SHA256, Python version and model_called: false. An existing output folder is refused. The JSON input is never overwritten.
02 / Inspect
Inspect what each copy shares
A Python shallow copy creates a new outer container while retaining references to its contents. A copied messages list can therefore still contain the same mutable message dictionaries. Python's copy documentation explains this distinction.
To see the first case directly, save this smaller version as inspect-copy.py in the extracted practice folder, then run python .\inspect-copy.py:
import json
from pathlib import Path
template = json.loads(Path("prompt-template.json").read_bytes())
a, b = template.copy(), template.copy()
a["messages"][0]["content"] = "Reply in 5 bullets."
assert a is not b
assert a["messages"][0] is b["messages"][0]
print(b["messages"][0]["content"])
print(template["messages"][0]["content"])
Both printed instructions say Reply in 5 bullets. The outer dictionaries differ; the inner system dictionary is the same object. Here is checks object identity. The == comparison used elsewhere in the report checks values.
- Outer copy: A, B and template share both nested branches. Both edits travel to B and the template.
- Messages list copy: the two lists differ, but their system dictionaries are still shared. The instruction edit still travels.
- Message dictionary copies: the string-content edit stays in A. The metadata branch was left shared, so B still receives A's tag.
- Separate deep copies: both edits stay in A, and the template retains its original values in this fixture.
- One deep copy of the batch: the original template stays unchanged, but A and B still share one copied object.
For these simple built-in values, create each independent variant in its own copying call. Save this as isolate-copy.py beside the JSON input and run python .\isolate-copy.py. Its checks complete without printing output:
from copy import deepcopy
import json
from pathlib import Path
template = json.loads(Path("prompt-template.json").read_bytes())
a, b = deepcopy(template), deepcopy(template)
a["messages"][0]["content"] = "Reply in 5 bullets."
a["metadata"]["review_tags"].append("edited-A")
assert b == template
assert b["messages"][0]["content"] == "Reply in 3 bullets."
assert b["metadata"]["review_tags"] == []
assert a["messages"][0] is not b["messages"][0]
a, b = deepcopy([template, template]) is one copying pass over two references to the same object. The copy operation preserves that repeated reference inside the result, so a is b remains true. Copying the whole batch does not create independent variants here.03 / Make it your own
Change one instruction, then inspect both requests
Try seven bullets with a new output directory:
python .\check-variants.py --bullets 7 --out adapted-output
We ran this adaptation. B changed to seven bullets in outer_copy, message_list_copy and deepcopy_batch. It retained three bullets in the other two cases. Only deepcopy_each kept B's tags empty while also preserving the original template.
For a workflow you own, start with synthetic inputs shaped like your requests. List the fields intended to vary and the nested fields intended to remain fixed. Build the variants, change one, then inspect the final request values immediately before dispatch. Add checks for the fields that matter to your experiment. An application that reconstructs requests from fresh values may use a different approach; verify its output with the same sort of example.
If your message content is itself a list of dictionaries, copying just the message dictionary leaves another nested layer to inspect. Do not assume a copy is independent simply because its printed values initially look right.
04 / Boundaries
Keep the evidence in scope
We exercised all five cases, the seven-bullet adaptation, the exact snippets above, source-byte preservation and the refusal to overwrite an existing report directory. We also reran the exercise from extracted local and public practice ZIPs. These checks concern the Python request objects in this small fictional fixture.
No AI answers, model quality, prompt effectiveness, real batch execution, concurrency or performance were tested. The included script makes no network calls. This result does not establish what a client library does when sending a request or when a service takes its snapshot.
Deep copying has its own limits: custom classes can control it, some resources are not copied, and intentionally shared state may need to remain shared. This example uses only ordinary JSON-shaped dictionaries, lists and strings. Review ownership of clients, files and other resources separately.
Optional AI review prompt, not run: “Inspect this fictional prompt-variant builder. Identify which mutable objects are shared between A, B and the template. Propose checks that show whether editing A changes B. Separate your reasoning from code you actually executed.”
05 / Primary sources
Read the primary sources
- Python 3.13: shallow and deep copying — references, recursive copying, the memo used in a copying pass, and limits.
- Python FAQ: why changing one list name can affect another — names, shared mutable objects and mutation.
- Python tutorial: list.copy — the list copy operation is shallow.
Primary sources checked November 24, 2026. Tested with CPython 3.13.15; the maintained 3.13 documentation may show a later patch version. This is a practical use of established Python behavior, not a new release announcement.
06 / Keep it handy
Get the practice and posting files
The practice ZIP contains the script, fictional template and README. The posting ZIP contains the original portrait, teaser caption, alt text and full article URL. Social content is prepared for manual posting; it has not been scheduled or published.
Browse more AI Anonymous field notes or talk with JABSystems about your workflow.

