-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
featureSupporting previously unsupported Python, new native types, new features, etc.Supporting previously unsupported Python, new native types, new features, etc.priority-1-normalpython compatMypyc doesn't match CPython or documented semantics.Mypyc doesn't match CPython or documented semantics.
Description
We currently don't support code like x = foo() + await bar()
, since the result of calling foo()
will be stored in a temporary that is not spilled to the environment.
I think that the best approach to solve this is to add another compiler pass that detects values that live across yields (which may just be the values that are live on function entry?) and spills them to the environment.
I think that scheme would also let us get rid of the manual spilling we do of compiler-induced temporaries in a bunch of situations (exception handling, with, etc). With some care it could maybe also subsume a bunch of the spill handling for nested functions too?
Metadata
Metadata
Assignees
Labels
featureSupporting previously unsupported Python, new native types, new features, etc.Supporting previously unsupported Python, new native types, new features, etc.priority-1-normalpython compatMypyc doesn't match CPython or documented semantics.Mypyc doesn't match CPython or documented semantics.