forked from vercel/python-typemap
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Status: NEEDS INVESTIGATION
Current Code Location
typemap/type_eval/_eval_typing.py, line 402-422
@_eval_types_impl.register
def _eval_nested_generic_alias(
obj: _AssociatedTypeGenericAlias, ctx: EvalContext
):
base, alias = obj.__args__
# TODO: what if it has parameters of its own
named_args = dict(
zip(
(p.__name__ for p in base.__origin__.__type_params__),
base.__args__,
strict=False,
)
)
# ...Question
The TODO asks: "what if it has parameters of its own?"
This refers to the case where base (the first argument to the associated type) is itself a generic class with type parameters.
Investigation Needed
- What happens when
base.__origin__.__type_params__is not empty? - Are there existing test cases that trigger this code path?
- Does the current implementation handle it correctly or is there a bug?
Suggested Approach
- Add test cases that would trigger
_eval_nested_generic_aliaswith parameterized generics - Verify if the current code handles this correctly
- If not, implement the fix
Resolution
This issue requires investigation before implementing a fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels