Conversation
|
|
||
| if (mod->verCompare(2, 1) >= 0 && mod->verCompare(3, 11) < 0) | ||
| m_freeVars = LoadObject(stream, mod).cast<PycSequence>(); | ||
| else if (mod->verCompare(3, 11) >= 0) |
There was a problem hiding this comment.
I think given the complicated structure this whole function should be rewritten appropriately.
There was a problem hiding this comment.
Honestly seems quite hard to rewrite this function. I think default initializations would be quite useful here.
There was a problem hiding this comment.
Default initializations themselves are not trivial :| It's annoying as well. I shall skip simplifying this logic at the moment.
| pyc_output << "\n"; | ||
| } | ||
|
|
||
| PycCode::nonlocals_t non_locals = code->getNonLocals(); |
There was a problem hiding this comment.
Easier to duplicate from globals instead of handling both together. Can be changed if need be.
|
Requesting review @greenozon @zrax |
| m_names = LoadObject(stream, mod).cast<PycSequence>(); | ||
|
|
||
| // Represents localsplusnames for py 3.11+ | ||
| if (mod->verCompare(1, 3) >= 0) |
There was a problem hiding this comment.
umm so this variable is being used for two different purposes - corresponds to locals before 3.11 and localsplusnames after 3.11. More like locals has been repurposed in cpython to include non local and global variables as well.
|
@zrax Hoping you can take a look at this one too. Thanks again! |
locals+namesfor Py 3.11+COPY_FREE_VARSandMAKE_CELLwith tests