Repository navigation
Conversation
… packing def f(a, **kwargs: T) appends a dict[str, T] param to the signature, mirroring *args: T -> list[T]. Call sites bind leftover named keywords into a dict literal in declaration order; kwargs is a normal dict in the body. f(**d) call-site unpack stays fenced (a dict type carries no static key set to prove member binding). Unannotated **kwargs keeps the PS1202 parameter-form fence.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Deploying pyscriptc with
|
| Latest commit: |
65c917b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5141aaff.pyscriptc.pages.dev |
| Branch Preview URL: | https://work-t2-kwargs.pyscriptc.pages.dev |
This branch has not been deployed
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.
Summary
T2-4
**kwargsnormalization (tiered-lowering plan).def f(a, **kwargs: T)lowers like*args: the signature gains a trailingdict[str, T]param flaggedkwarg, and_fill_varargspacks leftover named keywords into a dict literal in declaration order. Inside the bodykwargsis a normal dict (in,[],.get, iteration over keys).Shipped path choices:
f(**d)call-site unpack stays fenced (PS2002): adict[str, T]carries no static key set, so we can't prove member binding to declared params or that the remainder fits the kwargs dict.def f(**kwargs)keeps the existing PS1202 parameter-form fence;**kwargs: boolfences (dict values of bool are not lowered).*args+**kwargscombos pack both tails; extra positionals without*argskeep PS1003.Tests:
tests/test_t2_kwargs.py— IR-shape tests plus oracle-diff vs CPython for capture + iteration + membership. Self-census unchanged (1023 fences / 27 modules): all logic folded into_signatureand_fill_varargs, no new annotated defs.Link to Devin session: https://app.devin.ai/sessions/7578e5a801c14aa8a18e7e7d4b6d2bc5
Open in Devin Desktop: https://app.devin.ai/desktop/session/7578e5a801c14aa8a18e7e7d4b6d2bc5?variant=devin
Requested by: @espetro