← Back to Pull requests

feat(request): add arg `allow_multiple` to `get_param` & friends #2731

Closed
unknown closed this pull request without merging on Sep 28, 2026 07:43 UTC
View on GitHub
unknown unknown commented on Sep 09, 2026 16:01 UTC
Author

Summary of Changes

This adds an optional argument single to Request.get_param.

When this argument is set to True, get_param will raise an exception if the requested parameter has multiple values. This turns the undefined behavior (what value is returned) into an error.

The inspiration for this was a LLM assisted migration to falcon4 of another codebase. This codebase tries to be strict and for that reason the LLM noted that the get_param behaviour of returning a value at will was troublesome and it suggested a large helper function.
I declined and wrote this instead.

Related Issues

Fixes #2735.

Pull Request Checklist

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).

  • Added tests for changed code.

  • Performed automated tests and code quality checks by running tox.

  • Prefixed code comments with GitHub nick and an appropriate prefix.

  • Coding style is consistent with the rest of the framework.

  • Updated documentation for changed code.

  • - [x] Added docstrings for any new classes, functions, or modules.
    - [x] Updated docstrings for any modifications to existing code.
    - [x] Updated both WSGI and ASGI docs (where applicable).
    - [x] Added references to new classes, functions, or modules to the relevant RST file under docs/.
    - [x] Updated all relevant supporting documentation files under docs/.
    - [x] A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    - [ ] Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run tox -e docs, and inspect docs/_build/html/changes/ in the browser to ensure it renders correctly.)

  • LLM output, if any, has been carefully reviewed and tested by a human developer. (See also: Use of LLMs ("AI").)
  • If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

    PR template inspired by the attrs project.

    Diff: 335 lines (+251 / -84) across 4 files Reviewer: warsaw Review duration: 26861m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 335 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2731"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.2% (MEDIUM) · Higher = larger blast radius
    47.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.6% · Safe to merge
    18.6%