Message192072
Let's have a simple script test.py:
def f():
return x
x = 2
print(f())
Now if we try to run it via runpy.run_path, we get the following:
>>> import runpy
>>> g = runpy.run_path("test.py")
2
>>> g["f"]() is None
True
>>> g["x"] is 2
True
>>> g["f"].__globals__["x"] is None
True
Is the behaviour of f.__globals__ after return from run_path intended and why? |
|
Date |
User |
Action |
Args |
2013-06-30 14:33:02 | Drekin | set | recipients:
+ Drekin |
2013-06-30 14:33:02 | Drekin | set | messageid: <1372602782.77.0.618152195123.issue18331@psf.upfronthosting.co.za> |
2013-06-30 14:33:02 | Drekin | link | issue18331 messages |
2013-06-30 14:33:02 | Drekin | create | |
|