Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspicious index of rhs element in _check_unpack_assign #780

Open
acl-cqc opened this issue Jan 27, 2025 · 0 comments
Open

Suspicious index of rhs element in _check_unpack_assign #780

acl-cqc opened this issue Jan 27, 2025 · 0 comments

Comments

@acl-cqc
Copy link
Contributor

acl-cqc commented Jan 27, 2025

unpack.pattern.starred = self._check_assign(starred, rhs_elts[0], array_ty)

uses rhs_elts[0], when the indices that correspond to the starred section are rhs_elts[le:rs]. Not sure whether we should pass the whole range or one element; in many cases all rhs_elts are the same but not if the RHS is a literal tuple.

I played around with many test cases here and couldn't make a program that produced the wrong answer, so I suspect the value here is not used per se - perhaps only for debugging information or something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant