Skip to content

param_default: treat i2 placeholder defaults (methodize default_from) as no default - #50

Merged
thorwhalen merged 1 commit into
masterfrom
placeholder-default
Oct 20, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
placeholder-default

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #49.

param_default now uses i2.is_placeholder_default (NotSet or any i2.DefaultPlaceholder, such as the InstanceAttrDefault marker methodize(..., default_from=...) puts in a signature), with fallbacks to is_not_set and to the bare NotSet check for older i2. Both callers (mk_input_schema_from_func, ParamsSpecifier.from_func) go through it.

New test feeds a methodized function through the input schema and ParamsSpecifier (skipped on i2 without DefaultPlaceholder); it fails without the change.

🤖 Generated with Claude Code

Use i2.is_placeholder_default (NotSet or any i2.DefaultPlaceholder, e.g. the
marker methodize(..., default_from=...) puts in a signature), falling back to
is_not_set / NotSet for older i2. Closes #49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thorwhalen
thorwhalen merged commit f729b83 into master Oct 20, 2026
4 of 6 checks passed
@thorwhalen
thorwhalen deleted the placeholder-default branch October 20, 2026 18:29
thorwhalen added a commit that referenced this pull request Oct 20, 2026
__init__ updated self.__annotations__ in place, which is the class's dict once
it exists (always, on 3.10), so every instance's annotations leaked into later
ones. Master CI (3.10) failed on the ParamsSpecifier doctest after #50's test
ran from_func on another function first.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Treat methodize default_from placeholders as 'no default' (i2.is_placeholder_default)

1 participant