# HG changeset patch # User Paul Boddie # Date 1358036426 -3600 # Node ID 8c7e72691e5471598c76a8ed95f344ecfb9b7545 # Parent be6dee8789489437fdfaea68fc1bfcf917fab6e9 Added a note about module attribute declaration. diff -r be6dee878948 -r 8c7e72691e54 docs/syspython.txt --- a/docs/syspython.txt Sun Jan 13 01:19:41 2013 +0100 +++ b/docs/syspython.txt Sun Jan 13 01:20:26 2013 +0100 @@ -61,8 +61,8 @@ processed separately, but this would then rule out logic controlling the use of modules. -Assignments and name usage involves locals and globals but usage is -declared explicitly: +Assignments and name usage involve locals and globals but usage is declared +explicitly: __localnames__(...) @@ -71,8 +71,14 @@ __globalnames__(...) -Although at the module level, locals are effectively equivalent to module -globals, each module's __main__ function will declare them as globals. +At the module level, locals are effectively equivalent to module globals but +are declared as follows: + + __moduleattrs__(...) + +Each module's __main__ function will declare any referenced module globals as +globals. Note that the __main__ function is not a genuine attribute of any +module but an internal construct used to initialise modules appropriately. Such declarations must appear first in a program unit (module, function). For example: