Yeah, I read too fast...
"(all locals are fast locals except when a function uses exec or import *)" -- GvR on ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.
From experimenting, looks like globals can be modified (cc, dd, and ee). Any other interesting twists?
import pdb
def main():
a=1
print a
pdb.set_trace()
main()
cc = 5
print cc
dd = {4:44, 5:55}
print dd
ee = [4,4]
print ee
Bruce
···
-----Original Message-----
From: Grzegorz Makarewicz [mailto:mak@trisoft.com.pl]
Sent: Monday, April 07, 2003 9:54 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] RE: Re: Debugger for wxPython and Linux?
brucedickey wrote:
Grzegorz (Mak),
Thanks for the education. Had only tried the case as for "self.b" below, which is the only case that works. I've now read ALL LOCALS are "fast locals" -- learned something there.
Which isn`t true too - sometimes python creates locals on stack, but
sometimes not.
code='''
a=1
print a
'''
g={}
l=g
exec code in g,l
now play with warious combinations of g and l:
globals(), locals(), None and {}
then check Python/ceval.c exec_statement function
Happy hacking,
mak
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org