tests/globals_vs_locals.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/globals_vs_locals.py Sun Jun 21 02:02:53 2009 +0200 1.3 @@ -0,0 +1,17 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +b = 2 1.7 + 1.8 +def f(x): 1.9 + b = x 1.10 + 1.11 +def g(x): 1.12 + global b 1.13 + b = x 1.14 + 1.15 +f(3) 1.16 +result_2 = b 1.17 +g(4) 1.18 +result_4 = b 1.19 + 1.20 +# vim: tabstop=4 expandtab shiftwidth=4