[Python-bugs-list] [ python-Bugs-810714 ] nested variables in
'class:' statements
SourceForge.net
noreply at sourceforge.net
Mon Sep 22 15:16:16 EDT 2003
Bugs item #810714, was opened at 2003-09-22 12:05
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=810714&group_id=5470
Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Armin Rigo (arigo)
Assigned to: Nobody/Anonymous (nobody)
Summary: nested variables in 'class:' statements
Initial Comment:
from the user's point of view, variables originating
from nested scopes could erratically become bound in
the 'class' statement.
The 'class:' statements works by capturing all locals()
after executing the body; however, this is not exactly
the same as what an explicit call to locals() would
return because of the missing PyFrame_FastToLocals()
call in the implementation of LOAD_LOCALS in ceval.c.
It was thought that PyFrame_FastToLocals() was
unnecessary at that point because the class body
bytecode only uses LOAD_NAME/STORE_NAME and not fast
locals -- but this is no longer true with nested
scopes. See attached examples.
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-09-22 14:16
Message:
Logged In: YES
user_id=80475
Do you have a proposed patch?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=810714&group_id=5470
More information about the Python-bugs-list
mailing list