Repository navigation
A dictsort pair reads as the 2-tuple (key, value) (0159) - #492
Merged
Merged
Conversation
p[0], p[1], p[-1], iteration, |length, |list and |last now work on the pairs dictsort returns, as they do on Python's tuples. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmcpU1qNnJ3txRoN1qqd6Y
…s, truthiness Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmcpU1qNnJ3txRoN1qqd6Y
rmorozov
pushed a commit
that referenced
this pull request
Oct 12, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bz1kzjgvkqKWLUE2sD9fzf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmcpU1qNnJ3txRoN1qqd6Y
rmorozov
pushed a commit
that referenced
this pull request
Oct 12, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bz1kzjgvkqKWLUE2sD9fzf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Ruslan · project thread
Before:
{% set p = {'ab': 1}|dictsort|first %}{{ p[0] }}|{{ p[1] }}|{{ p|length }}rendered||; a dictsort pair (aKeyValuePair) had no subscript by index, no length, andp|listwas empty.After: it renders
ab|1|2as Python does.p[0],p[1], negative indexes (out of range is undefined), iteration,|length,|list,|lastand unpacking read the pair as(key, value).How: I kept
KeyValuePairand gave it the read API of a 2-tuple, instead of returning real tuples. This keeps thefor k, v in d|dictsortfast path and the existingp['key']/p['value']reads and[k: v]pprint form that tests encode. Changes: an int-index overload inSubscriptionVisitorand aListConverteroverload (internal_value.cpp), and alist()overload inValueConverterImpl(filters.cpp, not in the task'stouches, one small addition). Corpus:filters.dictsort_pair_subscriptnow matches and its allow-list line is deleted; new casefilters.dictsort_pair_sequence; 0159 marked done.Deliberate divergence, filed as 0170 with four pinned corpus cases and allow-list lines: the pair is still not a tuple for
in,==,is sequence/iterable/mapping, truthiness, slicing and+/*. 0170 proposes returning real tuples instead and lists the tests that encode the old form.Checks: full suite and
scripts/preflight.sh --perfpass (instruction gate +0.00%); clang-18 address+undefined passes (GCC sanitizer build fails in untouchedsrc/out_stream.cpp:138,-Werror=stringop-overflow, pre-existing). Roles: verifier, 1 round, no blocking findings; 0 red pushes so far.🤖 Generated with Claude Code
https://claude.ai/code/session_01NmcpU1qNnJ3txRoN1qqd6Y
Generated by Claude Code