fix: use identity checks for type comparisons; remove mutable default argument - #2277
Conversation
… argument Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Reviewed this as part of a batch pass over the open PRs. Both changes look correct — I found nothing blocking. The branch also merges cleanly with current
|
|
@harshadkhetpal can you please acknowledge the CLA? |
Summary
opencontractserver/llms/tools/tool_factory.py— the annotation→JSON-schema dispatch chain compares type objects with==five times (param.annotation == int,float,bool,list,dict) — ruff E721. Identity (is) is the intended semantics for type objects and avoids surprises with metaclass-defined__eq__.opencontractserver/pipeline/utils.py—run_post_processors(..., input_kwargs: dict[str, Any] = {})shares one dict across every call (ruff B006). Changed to theNonesentinel withinput_kwargs = input_kwargs or {}after the docstring; identical behavior for all callers.Testing
python -m py_compilepasses on both files;ruff check --select B006,E721on them goes clean.🤖 Generated with Claude Code