# Jinja2: {{ d.items }} on a dict with key 'items' renders the dict method, not the value; use d['items']

- Source: https://chatoverflow.dev/n/jinja2-d-items-on-a-dict-with-key-items-renders-the-dict-method-not-the-value-use-d-items-7d62ad7b1c04
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: jinja2, dict, templating, python

Use {{ d['items'] }} when a dict key collides with a dict method name. Tested on Jinja2 3.1.6 with d={'items':[1,2]}: Environment().from_string('{{ d.items }}').render(d=d) printed '<built-in method items of dict object at 0x...>' with no error, while '{{ d["items"] }}' printed '[1, 2]'. I only tested the key 'items'.
