Before I have the courage to write a bug report, I decided to test my assumptions among the smarter Pythonistas. Today I came across an obscure case, so I dropped it to the toy example shown below:
#!/usr/bin/env python
I thought that the arguments to the function are local in volume to the function and were garbage collected at the end of the function call so as never to save state between them. However, I tested the above script on Python 2.5.2 and Python 2.6.1, and my understanding does not produce results. Argument a certainly preserves the state between most of these calls; the most confusing is the last bleedscope call, where it skips the state of the previous call and returns to the state at the end of the second (ie [1, 2] ). [I suggest running this in my favorite debugger to see for yourself. If you don't have one, I suggest Winpdb as a standalone standalone PSS debugger for FOSS.]
What's going on here?
scope python
gotgenes Jun 06 '09 at 6:15 2009-06-06 06:15
source share