Skip to content

Fix: add_sig_param: pass annotation to Parameter - #917

Open
RensDimmendaal wants to merge 1 commit into
mainfrom
fix/sig-param-annotation
Open

Fix: add_sig_param: pass annotation to Parameter#917
RensDimmendaal wants to merge 1 commit into
mainfrom
fix/sig-param-annotation

Conversation

@RensDimmendaal

@RensDimmendaal RensDimmendaal commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

add_sig_param builds the injected Parameter without annotation=, storing the type only in f.__annotations__. This used to work because fastcore's old signature_ex merged __annotations__ back over an explicit __signature__, an undocumented side effect of its pre-3.10 backport.

The signature_ex rewrite in fastcore delegates to stock inspect.signature, which returns __signature__ verbatim. Injected params therefore arrive with no annotation and are ignored by the request machinery. Which explains the failing test in #916

Fix: pass annotation=typ when constructing the Parameter, putting the type in the signature itself.

@RensDimmendaal RensDimmendaal added the bug Something isn't working label Aug 12, 2026
@RensDimmendaal
RensDimmendaal requested a review from jph00 August 13, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant