frameobject.c bug ? No call to PyFrame_LocalsToFast.

Tim Peters tim.one at comcast.net
Thu Apr 11 21:18:37 EDT 2002


[Boris Boutillier]
> I've been looking through the frameObject.c code and looked for what
> happened, and surprised, there is no call to PyFrame_LocalsToFast when a
> frame is created, so if f_locals isn't empty (which can be the case if
> CO_NEWLOCALS is set to 0 the fast access values aren't initialised ).
> Is there a reason for this ?

CO_NEWLOCALS is always 1, except for code at module scope, in which latter
case locals and globals are the same thing and the LOAD_NAME (etc) opcodes
are used instead of LOAD_FAST (etc).  IOW, it's skipping an expense that's
never needed in code generated by the Python compiler.






More information about the Python-list mailing list