(original) (raw)
diff -r 5d16d956506c Doc/tutorial/classes.rst --- a/Doc/tutorial/classes.rst Tue Mar 06 15:37:36 2012 +0100 +++ b/Doc/tutorial/classes.rst Tue Mar 06 22:53:08 2012 +0200 @@ -180,6 +180,8 @@ scope_test() print("In global scope:", spam) +.. highlightlang:: none + The output of the example code is:: After local assignment: test spam @@ -187,6 +189,8 @@ After global assignment: nonlocal spam In global scope: global spam +.. highlightlang:: python + Note how the *local* assignment (which is default) didn't change *scope_test*\'s binding of *spam*. The :keyword:`nonlocal` assignment changed *scope_test*\'s binding of *spam*, and the :keyword:`global` assignment changed the module-level