Message81530
Assignments to vars() behave incorrectly if those variables are use
later on in a function.
For example, try this:
======
#!/usr/bin/python
def zz():
for i in [1,2,3]:
for j in [4,5,6]:
vars()['fw_%s_%s' % (j,i)] = 'test %s %s' % (j, i)
print vars()['fw_%s_%s' % (j,i)]
fw_4_2 = 'zz'
print fw_4_2
zz()
======
The assignments work fine up till 4_2. At 4_2, the assignment apparently
fails silently, and the print raises a keyError exception. |
|
Date |
User |
Action |
Args |
2009-02-10 05:14:43 | pest | set | recipients:
+ pest |
2009-02-10 05:14:43 | pest | set | messageid: <1234242883.43.0.910584647004.issue5197@psf.upfronthosting.co.za> |
2009-02-10 05:14:41 | pest | link | issue5197 messages |
2009-02-10 05:14:41 | pest | create | |
|