You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm finding that the current build doesn't seem to be able to even import the added Lib/test/future_co_annotations.py file without a crash; I'm wondering if I'm doing something wrong, or if this is a known issue?
The issue I'm seeing is that the compiler puts a tuple of (<co_annotations code object>, locals()) on the stack in a case where the annotations make use of local names (e.g. the Nested.f case in future_co_annotations.py), but there doesn't seem to be any handling of such a tuple in MAKE_FUNCTION target in ceval; it just crashes on the assert(TOP()->ob_type == &PyCode_Type); because the stack top is a tuple, not a code object.
If this is known issue that needs fixing, I may be able to work on a fix, just wanted to check first whether this is the right rabbit hole to go down.
The text was updated successfully, but these errors were encountered:
Ok, on revisiting this and looking at b42ce63 more closely, I realized the issue here is simply an assert that wasn't updated, so it only crashes on a debug build. Updating the assert so it accepts either a code object or a tuple is sufficient to make debug builds happy too.
Context: I'm aiming to test import performance of
__future__.co_annotations
(relative to__future__.annotations
) on a large realistic annotation-heavy codebase, as I offered to do in https://mail.python.org/archives/list/[email protected]/message/VBG2LXU6OHROQ3NPF373L7W4W23B24DE/I'm finding that the current build doesn't seem to be able to even import the added
Lib/test/future_co_annotations.py
file without a crash; I'm wondering if I'm doing something wrong, or if this is a known issue?The issue I'm seeing is that the compiler puts a tuple of
(<co_annotations code object>, locals())
on the stack in a case where the annotations make use of local names (e.g. theNested.f
case infuture_co_annotations.py
), but there doesn't seem to be any handling of such a tuple inMAKE_FUNCTION
target in ceval; it just crashes on theassert(TOP()->ob_type == &PyCode_Type);
because the stack top is a tuple, not a code object.If this is known issue that needs fixing, I may be able to work on a fix, just wanted to check first whether this is the right rabbit hole to go down.
The text was updated successfully, but these errors were encountered: