Conversation begins at https://discord.com/channels/267624335836053506/846434317021741086/850821189097226260
well mypyc compiles to C code. you can inspect it in build/__native.c
search for something like "fudebopeva.py", "<module>", 42
and you'll find the code it generates for line 42
so it's doing this
cpy_r_r147 = CPyStatics[17]; /* 'DEFAULT_TOKEN' */
cpy_r_r148 = CPyDict_GetItem(cpy_r_r146, cpy_r_r147);
which looks a lot like it's looking up DEFAULT_TOKEN in the globals dict then if it's successful it turns the PyObject into a tagged integer and I just realized that's why I got confused, all the integer values are multiplied by 2 because the last bit is used as a tag ... so then it does
cpy_r_r150.f0 = 8;
cpy_r_r150.f1 = cpy_r_r149;
8 = 4 = PERCENT so that's how it makes the pair (PERCENT, DEFAULT_TOKEN)
https://www.benfrederickson.com/profiling-native-python-extensions-with-py-spy/