fix(types): use typing.Callable instead of lowercase 'callable'#45641
Open
KeyArgo wants to merge 1 commit into
Open
fix(types): use typing.Callable instead of lowercase 'callable'#45641KeyArgo wants to merge 1 commit into
KeyArgo wants to merge 1 commit into
Conversation
…NousResearch#32848 NousResearch#13) The lowercase 'callable' is the builtin 'any()'-style predicate function, not the type. The intended type was 'typing.Callable'. Files changed: - run_agent.py:48 — added Callable to typing import - run_agent.py:5098, 5105 — callable → Callable - tools/delegate_tool.py:31 — added Callable to typing import - tools/delegate_tool.py:728 — callable → Callable The Python interpreter doesn't catch this at runtime (callable is always truthy when used as an annotation and silently gets stored as a string under PEP 563), but static type checkers (mypy, pyright) rightly flag it as invalid. The previous tools/microsoft_graph_client.py and others already use Callable correctly. Fixes NousResearch#32848 (part 13)
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
Fix from issue #32848 audit (item 13). The lowercase
callableisthe builtin
any()-style predicate function, not a type. Theintended type was
typing.Callable.Changes
run_agent.py:48— addedCallableto typing importrun_agent.py:5098, 5105—callable→Callabletools/delegate_tool.py:31— addedCallableto typing importtools/delegate_tool.py:728—callable→CallableBehavior
The Python interpreter doesn't catch this at runtime (callable is
always truthy when used as an annotation under PEP 563 deferred
evaluation). But static type checkers (mypy, pyright) flag it as
invalid, and IDE autocomplete/intellisense is degraded.
Risk
None. Type-only fix. No runtime behavior change. Test suite should
pass unchanged (and does, locally).
Fixes #32848 (part 13)