Add str.format_map(mapping, /) #1482
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.45) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 276 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.336
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1482"
general
weight: 0.35
jaheba
Implements
str.format_map(mapping, /)onstr.FormatArgumentsincrates/monty/src/str_format.rswith aMapping(Value)variant sostr.format_map()reuses the existing PEP 3101 format string parser, conversions, nested format specs, attribute/item accesses, and resource-limit checks while delegating named root field lookups directly tomapping.py_getitem(key, vm).dict,collections.defaultdict,collections.Counter, and user-defined mappings implementing__getitem__.{},{0}, etc.) withValueError: Format string contains positional fieldsand validates the single positional-onlymappingargument.docs/limitations/format.md.Part of #1275 and #1319.
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Implements
str.format_map(mapping, /), which previously raisedAttributeError. It reuses the existing PEP 3101 format string parser fromstr.format(), so conversions, nested format specs, attribute/item access, and resource-limit checks all work identically, but named root field lookups delegate tomapping.__getitem__.dict,defaultdict,Counter, and any user-defined mapping with__getitem__.{},{0}) raiseValueError: Format string contains positional fields, matching CPython.mappingargument is positional-only and validated to accept exactly one argument with no kwargs.docs/limitations/format.mdand adds a test case file.Part of #1275 and #1319.
<sup>Written for commit 807982c043a57c82b37ef45a83256dc2e852505b. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1482?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->