CodeSampleX

Sample

Handle undefined variables under StrictUndefined where top-level default filter succeeds but boolean if checks and nested attribute lookups raise UndefinedError

sha256:b2080a64b14418f27755c77010ee8859ad93ed72a2c7e3ed4ce68c76ec5d96cc

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Handle undefined variables under StrictUndefined where top-level default filter succeeds but boolean if checks and nested attribute lookups raise UndefinedError HOW
Packages
jinja2 3.1.6
Environment
python
Created
2026-08-17T03:19:31Z

Commonly assumed

Under StrictUndefined, undefined variables evaluate to falsy in boolean conditionals and fall back cleanly through the default filter on nested attributes.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts