- Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
buggood first issuepython compatMypyc doesn't match CPython or documented semantics.Mypyc doesn't match CPython or documented semantics.
Description
In code like this we should iterate over the rvalue first before performing any assignments to match Python semantics:
o.x, o.y = itWe currently interleave assignments and iteration in some cases. The evaluation order is correct if the rvalue is a list or a tuple, but not for arbitrary iterables. Assignments and iteration can have side effects, so in some edge cases these two approaches will produce different results.
Dealing with *x lvalues may make the implementation somewhat tricky (not sure though).
For more context, see python/mypy#9800 (review).
Metadata
Metadata
Assignees
Labels
buggood first issuepython compatMypyc doesn't match CPython or documented semantics.Mypyc doesn't match CPython or documented semantics.