GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Values support in call, callwith · Issue #86 · Technologicat/unpythonic

Values support in call, callwith #86

New issue
Copy link
New issue
Copy link
Closed
Closed
Values support in call, callwith#86
Copy link
Assignees
Technologicat
Labels
enhancementNew feature or requestNew feature or request
Milestone
2.2.0

Description

@Technologicat
Technologicat
opened on Sep 20, 2023
Issue body actions

For completeness, the call and callwith functions should support the Values abstraction, for unpacking multiple and/or named return values into function arguments. The function composition utilities already support this.

Instead of *a and **kw, if given exactly one positional argument x, and type(x) is Values, then unpack it, thus populating *a and **kw.

Activity

  1. Technologicat
    added
    enhancementNew feature or requestNew feature or request
    on Sep 20, 2023
  2. Technologicat
    self-assigned this
    on Sep 20, 2023
  3. Technologicat
    added this to the 2.2.0 milestone on Apr 24, 2026
  4. Technologicat
    closed this as completedin 5bcf3d4on May 4, 2026
  5. Technologicat commented on May 4, 2026

    @Technologicat
    Technologicat
    on May 4, 2026
    OwnerAuthor
    More actions

    Implemented in 2.2.0.

    —Technologicat

  6. Technologicat commented on May 4, 2026

    @Technologicat
    Technologicat
    on May 4, 2026
    OwnerAuthor
    More actions

    Implemented in 5bcf3d4, generalized in dfe73ee, for 2.2.0.

    call and callwith now unpack Values in their positional arguments. Each Values expands in place, left-to-right: its rets splice into the positional arguments, its kwrets merge into the keyword arguments. Across multiple Values and the explicit kwargs, rightmost wins per unique keyword name (explicit kwargs are syntactically last, so they always override).

    Mirrors Python's familiar spread/merge semantics — [*a, *b, c] for the positional side, {**a, **b} for the keyword side. The use case is taking a Values produced by one function and applying it as the arguments to another — including spread-and-override patterns where a Values carries defaults and explicit kwargs override individual keys.

    Trigger uses isinstance (not strict type is), matching the existing Values-output handling in unpythonic.fun's composition utilities (fun.py:908). The type is tuple check in valuify is qualitatively different: there it's recognising the pythonic tuple-as-multiple-return-values idiom, where exactness matters.

    The first iteration (5bcf3d4) was a leading-position-only unpack with trailing-args override, justified using a curry-passthrough scenario. On closer inspection (fun.py:361–437), curry has its own dedicated Values-merging logic with a callable-leftmost promotion that doesn't generalize, so the curry argument didn't actually motivate any special-casing in call/callwith. The follow-up (dfe73ee) drops the asymmetry and treats this as plain spread.

    Implementation factored into a private _maybe_unpack_values(args, kwargs) helper, shared by call and callwith. For callwith, the unpack runs at definition time (when args/kwargs are frozen), so the inner closure captures the already-expanded values.

    Logged under Changed in CHANGELOG; tests in unpythonic/tests/test_funutil.py.

    — Claude (Opus 4.7)

  7. Technologicat
    added a commit that references this issue on May 4, 2026

    doc/features: document Values spread in call/callwith (#86)

    baf1bbb
  8. Technologicat
    added a commit that references this issue on May 12, 2026

    Release 2.2.0 "Hail Eris"

    2e57b03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Technologicat
    Technologicat

Labels

enhancementNew feature or requestNew feature or request

Projects

No projects

    Milestone

    • 2.2.0No due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.