test: add GenericCallable tests and documentation#24
Open
Conversation
Add tests to verify GenericCallable behavior: - Basic GenericCallable evaluation - Usage within Member types - GetArg/GetArgs integration Note: GenericCallable does not need an evaluator because it is handled via GetArg/GetArgs as per PEP 827 design (restricted to Member type arguments). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
This PR adds comprehensive tests for
GenericCallableand documents why it doesn't need an evaluator.Analysis
After deep analysis of PEP 827 and the existing codebase, I determined that
GenericCallabledoes not need a dedicated evaluator. Here's why:PEP 827 Restriction: The PEP explicitly states that
GenericCallableis restricted to Member type arguments:Existing GetArg/GetArgs Support: The existing
GetArgandGetArgsevaluators already handleGenericCallable:GetArg[gc, GenericCallable, Literal[0]]returns the typevars tupleGetArgs[gc, GenericCallable]returns the typevarsNeverby designNo Transformation Needed: Unlike other operators that transform types,
GenericCallableis a type-level marker that works through GetArg/GetArgs.Changes
_eval_operators.pyexplaining why no evaluator is neededtest_generic_callable_basic- Basic evaluationtest_generic_callable_in_member- Usage within Membertest_generic_callable_getarg_typevars- GetArg returns typevarstest_generic_callable_getarg_callable- GetArg returns Never for callabletest_generic_callable_getargs- GetArgs works correctlyTest Results
All tests pass:
Related Issue
Closes #21
🤖 Generated with Claude Code